Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
fix(client) : add sshkey encode in client update api call
Browse files Browse the repository at this point in the history
  • Loading branch information
smothiki committed Jul 8, 2014
1 parent b14228b commit 5703672
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions client/deis.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,9 +920,18 @@ def clusters_update(self, args):
body = {}
for k, arg in (('domain', '--domain'), ('hosts', '--hosts'),
('auth', '--auth'), ('type', '--type')):
v = args.get(arg)
if v:
body.update({k: v})
if k == 'auth' :
auth_path = os.path.expanduser(args['--auth'])
if not os.path.exists(auth_path):
print('Path to authentication credentials does not exist: {}'.format(auth_path))
sys.exit(1)
with open(auth_path) as f:
data = f.read()
body.update({'auth': base64.b64encode(data)})
else :
v = args.get(arg)
if v:
body.update({k: v})
response = self._dispatch('patch', '/api/clusters/{}'.format(cluster),
json.dumps(body))
if response.status_code == requests.codes.ok: # @UndefinedVariable
Expand Down

0 comments on commit 5703672

Please sign in to comment.