use bool type for all_tenants param

Change-Id: Ife56e399434bb6b51ce4aab1cc25cec3fc44d336
Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
This commit is contained in:
dongwenjuan 2017-02-10 16:39:22 +08:00
parent 34a3148f39
commit b8f6662075
6 changed files with 9 additions and 18 deletions

View File

@ -17,7 +17,7 @@ class Alarm(object):
def __init__(self, api):
self.api = api
def list(self, vitrage_id, all_tenants='0'):
def list(self, vitrage_id, all_tenants=False):
"""Get a all alarms on entity
:param vitrage_id: the id for the entity

View File

@ -27,12 +27,9 @@ class AlarmList(lister.Lister):
help="Vitrage id of the affected resource")
parser.add_argument('--all-tenants',
metavar='<0|1>',
nargs='?',
type=int,
const=1,
default=0,
default=False,
dest='all_tenants',
action='store_true',
help='Shows alarms of all the tenants in the '
'entity graph')

View File

@ -24,12 +24,9 @@ class RcaShow(show.ShowOne):
help='ID of an alarm')
parser.add_argument('--all-tenants',
metavar='<0|1>',
nargs='?',
type=int,
const=1,
default=0,
default=False,
dest='all_tenants',
action='store_true',
help='Shows alarms of all the tenants for the RCA')
return parser

View File

@ -41,12 +41,9 @@ class TopologyShow(show.ShowOne):
'Valid graph types: [tree, graph]')
parser.add_argument('--all-tenants',
metavar='<0|1>',
nargs='?',
type=int,
const=1,
default=0,
default=False,
dest='all_tenants',
action='store_true',
help='Shows entities of all the tenants in the '
'entity graph')

View File

@ -17,7 +17,7 @@ class Rca(object):
def __init__(self, api):
self.api = api
def get(self, alarm_id, all_tenants='0'):
def get(self, alarm_id, all_tenants=False):
"""Get RCA for an alarm
:param alarm_id: the id of the alarm

View File

@ -22,7 +22,7 @@ class Topology(object):
graph_type='graph',
query=None,
root=None,
all_tenants=0):
all_tenants=False):
"""Get a topology
:param root: the root of the topology graph