Skip to content

Commit

Permalink
Merge pull request #110 from rabi/master
Browse files Browse the repository at this point in the history
Don't use */* in accept header
  • Loading branch information
chungg authored Aug 20, 2020
2 parents 389077b + 0c8e21b commit cad2c27
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions gnocchiclient/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ def list2cols(cols, objs):
for o in objs]


def format_string_list(l):
return ", ".join(l)
def format_string_list(li):
return ", ".join(li)


def format_dict_list(l):
def format_dict_list(li):
return "\n".join(
"- " + ", ".join("%s: %s" % (k, v)
for k, v in elem.items())
for elem in l)
for elem in li)


def format_dict_dict(value):
Expand Down
2 changes: 1 addition & 1 deletion gnocchiclient/v1/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class Manager(object):
DEFAULT_HEADERS = {
"Accept": "application/json, */*",
"Accept": "application/json",
}

def __init__(self, client):
Expand Down
6 changes: 3 additions & 3 deletions gnocchiclient/v1/resource_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ def _resource_from_args(self, parsed_args, update=False):
resource['metrics'][name] = value
for metric in parsed_args.create_metric:
name, _, value = metric.partition(":")
if value is "":
resource['metrics'][name] = {}
else:
if value:
resource['metrics'][name] = {'archive_policy_name': value}
else:
resource['metrics'][name] = {}

return resource

Expand Down

0 comments on commit cad2c27

Please sign in to comment.