Merge "Remove -l param from ccp status command"
This commit is contained in:
commit
9275638dd5
|
@ -211,22 +211,17 @@ class ShowStatus(lister.Lister):
|
||||||
parser = super(ShowStatus, self).get_parser(*args, **kwargs)
|
parser = super(ShowStatus, self).get_parser(*args, **kwargs)
|
||||||
parser.set_defaults(**CONF.action._dict)
|
parser.set_defaults(**CONF.action._dict)
|
||||||
|
|
||||||
parser.add_argument("-l", "--long",
|
|
||||||
action="store_true",
|
|
||||||
help="show all components status")
|
|
||||||
parser.add_argument("-s", "--short",
|
parser.add_argument("-s", "--short",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
help="show cluster status (ready or not)")
|
help="show only state (ok/wip/not deployed)")
|
||||||
parser.add_argument("components",
|
parser.add_argument("components",
|
||||||
nargs="*",
|
nargs="*",
|
||||||
help="CCP conponents to show status")
|
help="CCP components to show status")
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
config.load_component_defaults()
|
config.load_component_defaults()
|
||||||
if parsed_args.long:
|
if parsed_args.short:
|
||||||
return status.show_long_status()
|
|
||||||
elif parsed_args.short:
|
|
||||||
return status.show_short_status(parsed_args.components)
|
return status.show_short_status(parsed_args.components)
|
||||||
else:
|
else:
|
||||||
return status.show_long_status(parsed_args.components)
|
return status.show_long_status(parsed_args.components)
|
||||||
|
|
|
@ -107,7 +107,7 @@ def show_long_status(components=None):
|
||||||
def show_short_status(components=None):
|
def show_short_status(components=None):
|
||||||
states = get_pod_states(components)
|
states = get_pod_states(components)
|
||||||
if not states:
|
if not states:
|
||||||
status = "no cluster"
|
status = "not deployed"
|
||||||
else:
|
else:
|
||||||
status = ST_OK if all(map(is_app_ready, states.values())) else ST_WIP
|
status = ST_OK if all(map(is_app_ready, states.values())) else ST_WIP
|
||||||
return ("status",), ((status,),)
|
return ("status",), ((status,),)
|
||||||
|
|
Loading…
Reference in New Issue