From: lombardofr Date: Tue, 2 Oct 2018 09:51:03 +0000 (+0200) Subject: fix parameter on instance creation X-Git-Tag: v5.0.0~27 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F01%2F6601%2F1;p=osm%2FLW-UI.git fix parameter on instance creation Change-Id: Idb3332b859110fd29fa6359c1e504b86128421ff Signed-off-by: lombardofr --- 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: