Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc doc fix + make clusters argument required #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions images/portal/resources/toolset/toolset/commands/grep.py
Expand Up @@ -36,7 +36,7 @@ class _Tool(Template):

def customize(self, parser):

parser.add_argument('clusters', type=str, nargs='*', default='*', help='1+ clusters (can be a glob pattern, e.g foo*)')
parser.add_argument('clusters', type=str, nargs='+', help='1+ clusters (can be a glob pattern, e.g foo*)')
parser.add_argument('-j', '--json', action='store_true', help='switch for json output')

def body(self, args, proxy):
Expand Down Expand Up @@ -67,7 +67,7 @@ def _query(zk):
logger.info(' '.join((val.ljust(width) for val, width in zip(row, widths))))

if args.json:

logger.info(json.dumps(outs))

return _Tool()
return _Tool()
4 changes: 2 additions & 2 deletions images/portal/resources/toolset/toolset/commands/log.py
Expand Up @@ -37,7 +37,7 @@ class _Tool(Template):

def customize(self, parser):

parser.add_argument('clusters', type=str, nargs='*', default='*', help='1+ clusters (can be a glob pattern, e.g foo*)')
parser.add_argument('clusters', type=str, nargs='+', help='1+ clusters (can be a glob pattern, e.g foo*)')
parser.add_argument('-l', action='store_true', dest='long', help='display the entire log')
parser.add_argument('-i', '--indices', action='store', dest='indices', type=int, nargs='+', help='1+ indices')

Expand All @@ -56,4 +56,4 @@ def _query(zk):
logger.info('<%s> -> %d%% replies (%d pods total) ->\n%s' % (token, pct, len(js), '\n'.join(unrolled)))


return _Tool()
return _Tool()
2 changes: 1 addition & 1 deletion images/portal/resources/toolset/toolset/commands/ls.py
Expand Up @@ -82,4 +82,4 @@ def _query(zk):
for row in rows:
logger.info(' '.join((val.ljust(width) for val, width in zip(row, widths))))

return _Tool()
return _Tool()
4 changes: 2 additions & 2 deletions images/portal/resources/toolset/toolset/commands/off.py
Expand Up @@ -39,7 +39,7 @@ class _Tool(Template):

def customize(self, parser):

parser.add_argument('clusters', type=str, nargs='*', default='*', help='1+ clusters (can be a glob pattern, e.g foo*)')
parser.add_argument('clusters', type=str, nargs='+', help='1+ clusters (can be a glob pattern, e.g foo*)')
parser.add_argument('-i', '--indices', action='store', dest='indices', type=int, nargs='+', help='1+ indices')
parser.add_argument('--force', action='store_true', dest='force', help='enables wildcards')

Expand All @@ -58,4 +58,4 @@ def _query(zk):
pct = (len(js) * 100) / total
logger.info('<%s> -> %d%% replies, %d pods off' % (token, pct, len(js)))

return _Tool()
return _Tool()
9 changes: 4 additions & 5 deletions images/portal/resources/toolset/toolset/commands/on.py
Expand Up @@ -29,16 +29,15 @@ class _Tool(Template):

help = \
'''
Switches one or more containers off (their sub-process being gracefully shutdown while the pod keeps
running). Individual containers can also be cherry-picked by specifying their sequence index and using
-i.
Switches one or more containers on. Individual containers can also be cherry-picked by specifying
their sequence index and using -i.
'''

tag = 'on'

def customize(self, parser):

parser.add_argument('clusters', type=str, nargs='*', default='*', help='1+ clusters (can be a glob pattern, e.g foo*)')
parser.add_argument('clusters', type=str, nargs='+', help='1+ clusters (can be a glob pattern, e.g foo*)')
parser.add_argument('-i', '--indices', action='store', dest='indices', type=int, nargs='+', help='1+ indices')

def body(self, args, proxy):
Expand All @@ -54,4 +53,4 @@ def _query(zk):
pct = (len(js) * 100) / total
logger.info('<%s> -> %d%% replies, %d pods on' % (token, pct, len(js)))

return _Tool()
return _Tool()
4 changes: 2 additions & 2 deletions images/portal/resources/toolset/toolset/commands/ping.py
Expand Up @@ -43,7 +43,7 @@ class _Tool(Template):
def customize(self, parser):

parser.add_argument('yaml', nargs=1, help='YAML file')
parser.add_argument('clusters', type=str, nargs='*', default='*', help='1+ clusters (can be a glob pattern, e.g foo*)')
parser.add_argument('clusters', type=str, nargs='+', help='1+ clusters (can be a glob pattern, e.g foo*)')
parser.add_argument('-j', action='store_true', dest='json', help='json output')

def body(self, args, proxy):
Expand Down Expand Up @@ -77,4 +77,4 @@ def _query(zk):
mark = failure.problem_mark
assert 0, '%s is invalid (line %s, column %s)' % (args.yaml, mark.line+1, mark.column+1)

return _Tool()
return _Tool()
6 changes: 3 additions & 3 deletions images/portal/resources/toolset/toolset/commands/poll.py
Expand Up @@ -37,7 +37,7 @@ class _Tool(Template):

def customize(self, parser):

parser.add_argument('clusters', type=str, nargs='*', default='*', help='1+ clusters (can be a glob pattern, e.g foo*).')
parser.add_argument('clusters', type=str, nargs='+', help='1+ clusters (can be a glob pattern, e.g foo*).')
parser.add_argument('-j', '--json', action='store_true', help='switch for json output')

def body(self, args, proxy):
Expand All @@ -55,7 +55,7 @@ def _query(zk):
return len(replies), {key: hints['metrics'] for key, (index, hints, code) in replies.items() if code == 200 and 'metrics' in hints}

total, js = run(proxy, _query)

outs.update(js)

#
Expand All @@ -69,7 +69,7 @@ def _query(zk):
widths = [max(map(len, col)) for col in zip(*rows)]
for row in rows:
logger.info(' '.join((val.ljust(width) for val, width in zip(row, widths))))

if args.json:

logger.info(json.dumps(outs))
Expand Down
6 changes: 3 additions & 3 deletions images/portal/resources/toolset/toolset/commands/port.py
Expand Up @@ -37,7 +37,7 @@ class _Tool(Template):
def customize(self, parser):

parser.add_argument('port', type=int, nargs=1, help='TCP port to lookup')
parser.add_argument('clusters', type=str, nargs='*', default='*', help='1+ clusters (can be a glob pattern, e.g foo*)')
parser.add_argument('clusters', type=str, nargs='+', help='1+ clusters (can be a glob pattern, e.g foo*)')
parser.add_argument('-j', '--json', action='store_true', help='switch for json output')

def body(self, args, proxy):
Expand Down Expand Up @@ -67,7 +67,7 @@ def _query(zk):
logger.info(' '.join((val.ljust(width) for val, width in zip(row, widths))))

if args.json:

logger.info(json.dumps(outs))

return _Tool()
return _Tool()
4 changes: 2 additions & 2 deletions images/portal/resources/toolset/toolset/commands/reset.py
Expand Up @@ -109,7 +109,7 @@ class _Tool(Template):

def customize(self, parser):

parser.add_argument('clusters', type=str, nargs='*', default='*', help='1+ clusters (can be a glob pattern, e.g foo*)')
parser.add_argument('clusters', type=str, nargs='+', help='1+ clusters (can be a glob pattern, e.g foo*)')
parser.add_argument('-i', '--indices', action='store', dest='indices', type=int, nargs='+', help='1+ indices')
parser.add_argument('-j', action='store_true', dest='json', help='json output')
parser.add_argument('--force', action='store_true', dest='force', help='enables wildcards')
Expand All @@ -134,4 +134,4 @@ def body(self, args, proxy):
return 0 if pct == 100 else 1


return _Tool()
return _Tool()
2 changes: 1 addition & 1 deletion images/portal/resources/toolset/toolset/commands/scale.py
Expand Up @@ -252,4 +252,4 @@ def body(self, args, proxy):
logger.info(json.dumps(outcome) if args.json else '%d%% success (%+d pods)' % (pct, delta))
return 0 if pct == 100 else 1

return _Tool()
return _Tool()