From d3e9f5c6b209bf4ee742f1781364f5dc4103539d Mon Sep 17 00:00:00 2001 From: lombardofr Date: Tue, 2 Oct 2018 11:51:03 +0200 Subject: [PATCH] fix parameter on instance creation Change-Id: Idb3332b859110fd29fa6359c1e504b86128421ff Signed-off-by: lombardofr --- bower.json | 2 +- instancehandler/views.py | 2 +- lib/osm/osmclient/clientv2.py | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bower.json b/bower.json index d8b5366..0a2e2a3 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "osm-lw-ui", "authors": [ - "Francesco Lombardo " + "Francesco Lombardo " ], "description": "OSM Light UI", "main": "", diff --git a/instancehandler/views.py b/instancehandler/views.py index d80d18d..45120e2 100644 --- a/instancehandler/views.py +++ b/instancehandler/views.py @@ -64,7 +64,7 @@ def create(request): "vimAccountId": request.POST.get('vimAccountId', ''), } if 'ssh_key' in request.POST and request.POST.get('ssh_key') != '': - ns_data["ssh-authorized-key"] = [request.POST.get('ssh_key')] + ns_data["ssh_keys"] = request.POST.get('ssh_key') if 'config' in request.POST: ns_config = yaml.load(request.POST.get('config')) diff --git a/lib/osm/osmclient/clientv2.py b/lib/osm/osmclient/clientv2.py index fa4117e..ad7072e 100644 --- a/lib/osm/osmclient/clientv2.py +++ b/lib/osm/osmclient/clientv2.py @@ -24,10 +24,13 @@ import StringIO from lib.util import Util import hashlib import os +from requests.packages.urllib3.exceptions import InsecureRequestWarning -logging.basicConfig(level=logging.DEBUG) -log = logging.getLogger('helper.py') +requests.packages.urllib3.disable_warnings(InsecureRequestWarning) +logging.basicConfig(level=logging.INFO) +log = logging.getLogger('helper.py') +logging.getLogger("urllib3").setLevel(logging.INFO) class Client(object): def __init__(self): @@ -113,8 +116,6 @@ class Client(object): 'Authorization': 'Bearer {}'.format(token['id'])} _url = "{0}/admin/v1/users/{1}".format(self._base_path, id) - print _url - print user_data try: r = requests.post(_url, json=user_data, verify=False, headers=headers) except Exception as e: -- 2.17.1