Skip to content

Commit

Permalink
Remove unused/mutable default args
Browse files Browse the repository at this point in the history
Having mutable default args is a bad idea
(http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments).

Change-Id: Id941f259ff362f306582be5c2e4bdea133149491
  • Loading branch information
andersonvom committed Aug 22, 2014
1 parent 7bbd75f commit c195f03
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion heatclient/common/utils.py
Expand Up @@ -57,7 +57,8 @@ def newline_list_formatter(r):
return '\n'.join(r or [])


def print_dict(d, formatters={}):
def print_dict(d, formatters=None):
formatters = formatters or {}
pt = prettytable.PrettyTable(['Property', 'Value'],
caching=False, print_empty=False)
pt.align = 'l'
Expand Down
9 changes: 4 additions & 5 deletions heatclient/v1/shell.py
Expand Up @@ -402,7 +402,7 @@ def do_stack_update(hc, args):
do_stack_list(hc)


def do_list(hc, args=None):
def do_list(hc):
'''DEPRECATED! Use stack-list instead.'''
logger.warning('DEPRECATED! Use stack-list instead.')
do_stack_list(hc)
Expand Down Expand Up @@ -479,16 +479,15 @@ def do_output_show(hc, args):
print (jsonutils.dumps(value, indent=2, ensure_ascii=False))


def do_resource_type_list(hc, args={}):
def do_resource_type_list(hc, args):
'''List the available resource types.'''
kwargs = {}
types = hc.resource_types.list(**kwargs)
types = hc.resource_types.list()
utils.print_list(types, ['resource_type'], sortby_index=0)


@utils.arg('resource_type', metavar='<RESOURCE_TYPE>',
help='Resource type to get the details for.')
def do_resource_type_show(hc, args={}):
def do_resource_type_show(hc, args):
'''Show the resource type.'''
try:
resource_type = hc.resource_types.get(args.resource_type)
Expand Down

0 comments on commit c195f03

Please sign in to comment.