summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Albertson <lance@osuosl.org>2021-04-09 15:10:12 -0700
committerLance Albertson <lance@osuosl.org>2021-04-09 16:12:53 -0700
commitc9eacde882fc413627168c557853fef2bd6aa49e (patch)
tree0c9f955b477057ed2fa6542b75e9f97e5ba25891
parentbb776e0ea82618c7c9038518ef9649c8d216b70d (diff)
downloadchef-c9eacde882fc413627168c557853fef2bd6aa49e.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.rb5
-rw-r--r--lib/chef/provider/package/rubygems.rb2
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 db3696dbd8..83f9cc18a5 100644
--- a/lib/chef/provider/package/rubygems.rb
+++ b/lib/chef/provider/package/rubygems.rb
@@ -423,7 +423,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