summaryrefslogtreecommitdiff
path: root/lib/chef/data_collector
diff options
context:
space:
mode:
authorAdam Leff <adam@leff.co>2016-12-07 15:51:14 -0500
committerAdam Leff <adam@leff.co>2016-12-07 15:53:08 -0500
commit9e77f0401b857b2ba1e4d00d8fa5ebc805050a88 (patch)
tree903a358c8d7a5e8667b1e7b0a2b685e6f4c7e811 /lib/chef/data_collector
parente2c5935b818c8d1a74e24ba624de1ae489909fdb (diff)
downloadchef-9e77f0401b857b2ba1e4d00d8fa5ebc805050a88.tar.gz
Fix Data Collector organization parsing regex
The regex used to pluck the Chef Server Organization from the chef_server_url config value did not permit hyphens in org names even though they are allowed by Chef Server. This caused org names to get incorrectly truncated when sending the payload to Data Collector servers. Re: Chef bug IPO-500 Signed-off-by: Adam Leff <adam@leff.co>
Diffstat (limited to 'lib/chef/data_collector')
-rw-r--r--lib/chef/data_collector/messages/helpers.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/data_collector/messages/helpers.rb b/lib/chef/data_collector/messages/helpers.rb
index d257b74893..a56ea4e829 100644
--- a/lib/chef/data_collector/messages/helpers.rb
+++ b/lib/chef/data_collector/messages/helpers.rb
@@ -76,7 +76,7 @@ class Chef
def chef_server_organization
return "unknown_organization" unless Chef::Config[:chef_server_url]
- Chef::Config[:chef_server_url].match(%r{/+organizations/+(\w+)}).nil? ? "unknown_organization" : $1
+ Chef::Config[:chef_server_url].match(%r{/+organizations/+([\w-]+)}).nil? ? "unknown_organization" : $1
end
#