Alexandros Kosiaris has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/246987

Change subject: hiera_lookup: Use sub instead of tr
......................................................................

hiera_lookup: Use sub instead of tr

The use of tr there means that dashes in the arguments get wiped out and
not only the leading dashes in front of the arguments. Use sub instead
and just remove the two leading dashes

Change-Id: I3a207c9197fe419f296a10746d28e5561e04d741
---
M utils/hiera_lookup
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/87/246987/1

diff --git a/utils/hiera_lookup b/utils/hiera_lookup
index cdae163..118cceb 100755
--- a/utils/hiera_lookup
+++ b/utils/hiera_lookup
@@ -38,7 +38,7 @@
 # Get the scope from the command line arguments
 def get_scope()
   # Transform the CL arguments in a dictionary in the form "::option" => 
argument
-  scope = Hash[ARGV.map { |kv| "::#{kv.tr('-', '')}".split('=') }]
+  scope = Hash[ARGV.map { |kv| "::#{kv.sub('--', '')}".split('=') }]
   abort(usage "Error: --fqdn=FQDN is required.") unless scope['::fqdn']
   scope['::hostname'] = scope['::fqdn'][/^[^.]+/]
   scope['::realm'] = scope['::fqdn'].include?('labs') ? 'labs' : 'production'

-- 
To view, visit https://gerrit.wikimedia.org/r/246987
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3a207c9197fe419f296a10746d28e5561e04d741
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to