diff options
author | Lance Albertson <lance@osuosl.org> | 2021-04-09 15:10:12 -0700 |
---|---|---|
committer | Lance Albertson <lance@osuosl.org> | 2021-04-09 15:11:15 -0700 |
commit | a8efbe6306f2c50fbfa718de1b2c9b7cf9b76f7d (patch) | |
tree | 52cb2f07de4f0de8384be587ab8583152aececaf | |
parent | db1d60056f7ab64bf6c1cede96541309f483f58a (diff) | |
download | chef-a8efbe6306f2c50fbfa718de1b2c9b7cf9b76f7d.tar.gz |
Create ChefUtils::Dist::Workstation::DIR_SUFFIX dist constant
This allows community distributions the ability to set the directory suffix for
where Workstation resides (aka /opt/chef-workstation).
Signed-off-by: Lance Albertson <lance@osuosl.org>
-rw-r--r-- | chef-utils/lib/chef-utils/dist.rb | 5 | ||||
-rw-r--r-- | lib/chef/provider/package/rubygems.rb | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/chef-utils/lib/chef-utils/dist.rb b/chef-utils/lib/chef-utils/dist.rb index c4fe72960d..1819aefb0b 100644 --- a/chef-utils/lib/chef-utils/dist.rb +++ b/chef-utils/lib/chef-utils/dist.rb @@ -87,6 +87,11 @@ module ChefUtils EXEC = "chef-solo" end + class Workstation + # The suffix for Chef Workstion's /opt/chef-workstation or C:\\opscode\chef-workstation + DIR_SUFFIX = "chef-workstation" + end + class Zero # chef-zero executable PRODUCT = "Chef Infra Zero" diff --git a/lib/chef/provider/package/rubygems.rb b/lib/chef/provider/package/rubygems.rb index bb4262a8d7..1a396a364b 100644 --- a/lib/chef/provider/package/rubygems.rb +++ b/lib/chef/provider/package/rubygems.rb @@ -421,7 +421,7 @@ class Chef end def is_omnibus? - if %r{/(#{ChefUtils::Dist::Org::LEGACY_CONF_DIR}|#{ChefUtils::Dist::Infra::SHORT}|chef-workstation)/embedded/bin}.match?(RbConfig::CONFIG["bindir"]) + if %r{/(#{ChefUtils::Dist::Org::LEGACY_CONF_DIR}|#{ChefUtils::Dist::Infra::SHORT}|#{ChefUtils::Dist::Workstation::DIR_SUFFIX})/embedded/bin}.match?(RbConfig::CONFIG["bindir"]) logger.trace("#{new_resource} detected omnibus installation in #{RbConfig::CONFIG["bindir"]}") # Omnibus installs to a static path because of linking on unix, find it. true |