[rubick] pep8 fixes
This commit is contained in:
@@ -6,13 +6,16 @@ import argparse
|
|||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
||||||
def arg_parse():
|
def arg_parse():
|
||||||
p = argparse.ArgumentParser(description = 'Rubick cli interface')
|
p = argparse.ArgumentParser(description='Rubick cli interface')
|
||||||
p.add_argument('-l', '--list-clusters', help = 'List clusters', default = None, action = 'store_true')
|
p.add_argument('-l', '--list-clusters',
|
||||||
p.add_argument('api', help = 'Api url', default = None)
|
help='List clusters', default=None, action='store_true')
|
||||||
|
p.add_argument('api', help='Api url', default=None)
|
||||||
|
|
||||||
return p.parse_args()
|
return p.parse_args()
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
args = arg_parse()
|
args = arg_parse()
|
||||||
|
|
||||||
@@ -21,7 +24,9 @@ def main():
|
|||||||
if (r.status_code == requests.codes.ok):
|
if (r.status_code == requests.codes.ok):
|
||||||
print "Avialable clusters:"
|
print "Avialable clusters:"
|
||||||
for cluster in json.loads(r.text):
|
for cluster in json.loads(r.text):
|
||||||
print "\t%s (%d nodes)" % (cluster['name'], len(cluster['nodes']))
|
print "\t%s (%d nodes)" % (
|
||||||
|
cluster['name'], len(cluster['nodes'])
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user