ArielGlenn has uploaded a new change for review.
https://gerrit.wikimedia.org/r/306653
Change subject: salt-misc: little bit of pep8/pylint
......................................................................
salt-misc: little bit of pep8/pylint
indentation, convert some comment styles, spaces around operators
Change-Id: I1bed1aac4181724b8980c7e4a845b1b9a928f959
---
M salt-misc/do_ssh_commands.py
M salt-misc/parse-minion-output.py
M salt-misc/salt-fixups.py
3 files changed, 15 insertions(+), 19 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/software
refs/changes/53/306653/1
diff --git a/salt-misc/do_ssh_commands.py b/salt-misc/do_ssh_commands.py
index e620c09..92da6c4 100755
--- a/salt-misc/do_ssh_commands.py
+++ b/salt-misc/do_ssh_commands.py
@@ -104,8 +104,8 @@
entry[minion] == match_value):
minions_good.append(minion)
elif (match_start is not None and
- isinstance(entry[minion], basestring) and
- entry[minion].startswith(match_start)):
+ isinstance(entry[minion], basestring) and
+ entry[minion].startswith(match_start)):
minions_good.append(minion)
elif match_value is None and match_start is None:
minions_good.append(minion)
diff --git a/salt-misc/parse-minion-output.py b/salt-misc/parse-minion-output.py
index 2a68664..1b874a0 100644
--- a/salt-misc/parse-minion-output.py
+++ b/salt-misc/parse-minion-output.py
@@ -76,13 +76,11 @@
hostdata['salt_id'] = line[4:]
elif line.startswith("master:"):
if not line[8:]:
- '''
- master:
- - labs-puppetmaster-eqiad.wikimedia.org
- - labs-puppetmaster-codfw.wikimedia.org
- and this terminates as soon as we see a line with non
- whitespace first char.
- '''
+ # master:
+ # - labs-puppetmaster-eqiad.wikimedia.org
+ # - labs-puppetmaster-codfw.wikimedia.org
+ # and this terminates as soon as we see a line with non
+ # whitespace first char.
want_master = True
else:
hostdata['masters'].append(line[8:])
@@ -190,7 +188,7 @@
if summary['masters']:
for master in summary['masters']:
if (not master == 'labs-puppetmaster-eqiad.wikimedia.org' and
- not master == 'labs-puppetmaster-codfw.wikimedia.org' and
+ not master == 'labs-puppetmaster-codfw.wikimedia.org'
and
not master == 'labcontrol2001.wikimedia.org'):
print summary['hostname'], summary['masters']
break
diff --git a/salt-misc/salt-fixups.py b/salt-misc/salt-fixups.py
index 2c93d43..fd27d56 100644
--- a/salt-misc/salt-fixups.py
+++ b/salt-misc/salt-fixups.py
@@ -52,13 +52,11 @@
for line in lines:
if line.startswith("master:"):
if not line[8:]:
- '''
- master:
- - labs-puppetmaster-eqiad.wikimedia.org
- - labs-puppetmaster-codfw.wikimedia.org
- and this terminates as soon as we see a line with non
- whitespace first char.
- '''
+ # master:
+ # - labs-puppetmaster-eqiad.wikimedia.org
+ # - labs-puppetmaster-codfw.wikimedia.org
+ # and this terminates as soon as we see a line with non
+ # whitespace first char.
want_master = True
else:
masters.append(line[8:])
@@ -400,8 +398,8 @@
# remove old entry
if has_keysize:
- if len(lines) > index+1:
- rest = lines[index+1:]
+ if len(lines) > index + 1:
+ rest = lines[index + 1:]
else:
rest = []
lines = lines[0:index] + rest
--
To view, visit https://gerrit.wikimedia.org/r/306653
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1bed1aac4181724b8980c7e4a845b1b9a928f959
Gerrit-PatchSet: 1
Gerrit-Project: operations/software
Gerrit-Branch: master
Gerrit-Owner: ArielGlenn <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits