Skip to content

Commit df72bc7

Browse files
author
Gabriel Monroy
committed
change config:list, set and unset to use app endpoints
1 parent e54f9e2 commit df72bc7

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

client/deis.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -651,14 +651,14 @@ def config_list(self, args):
651651
652652
Usage: deis config:list
653653
"""
654-
formation = args.get('--formation')
655-
if not formation:
656-
formation = self._session.formation
657-
response = self._dispatch('get', "/api/formations/{}/config".format(formation))
654+
app = args.get('--app')
655+
if not app:
656+
app = self._session.app
657+
response = self._dispatch('get', "/api/apps/{}/config".format(app))
658658
if response.status_code == requests.codes.ok: # @UndefinedVariable
659659
config = response.json()
660660
values = json.loads(config['values'])
661-
print("=== {} Config".format(formation))
661+
print("=== {} Config".format(app))
662662
items = values.items()
663663
if len(items) == 0:
664664
print('No configuration')
@@ -672,19 +672,19 @@ def config_set(self, args):
672672
"""
673673
Set environment variables for a formation
674674
675-
Usage: deis config:set <var>=<value>...
675+
Usage: deis config:set <var>=<value>... [--app=<app>]
676676
"""
677-
formation = args.get('--formation')
678-
if not formation:
679-
formation = self._session.formation
677+
app = args.get('--app')
678+
if not app:
679+
app = self._session.app
680680
body = {'values': json.dumps(dictify(args['<var>=<value>']))}
681681
response = self._dispatch('post',
682-
"/api/formations/{}/config".format(formation),
682+
"/api/apps/{}/config".format(app),
683683
json.dumps(body))
684684
if response.status_code == requests.codes.created: # @UndefinedVariable
685685
config = response.json()
686686
values = json.loads(config['values'])
687-
print("=== {}".format(formation))
687+
print("=== {}".format(app))
688688
items = values.items()
689689
if len(items) == 0:
690690
print('No configuration')
@@ -698,22 +698,22 @@ def config_unset(self, args):
698698
"""
699699
Unset an environment variable for a formation
700700
701-
Usage: deis config:unset <key>...
701+
Usage: deis config:unset <key>... [--app=<app>]
702702
"""
703-
formation = args.get('--formation')
704-
if not formation:
705-
formation = self._session.formation
703+
app = args.get('--app')
704+
if not app:
705+
app = self._session.app
706706
values = {}
707707
for k in args.get('<key>'):
708708
values[k] = None
709709
body = {'values': json.dumps(values)}
710710
response = self._dispatch('post',
711-
"/api/formations/{}/config".format(formation),
712-
data=json.dumps(body))
711+
"/api/apps/{}/config".format(app),
712+
json.dumps(body))
713713
if response.status_code == requests.codes.created: # @UndefinedVariable
714714
config = response.json()
715715
values = json.loads(config['values'])
716-
print("=== {}".format(formation))
716+
print("=== {}".format(app))
717717
items = values.items()
718718
if len(items) == 0:
719719
print('No configuration')

0 commit comments

Comments
 (0)