fix parameter on instance creation 01/6601/1
authorlombardofr <lombardo@everyup.it>
Tue, 2 Oct 2018 09:51:03 +0000 (11:51 +0200)
committerlombardofr <lombardo@everyup.it>
Tue, 2 Oct 2018 09:51:03 +0000 (11:51 +0200)
Change-Id: Idb3332b859110fd29fa6359c1e504b86128421ff
Signed-off-by: lombardofr <lombardo@everyup.it>
bower.json
instancehandler/views.py
lib/osm/osmclient/clientv2.py

index d8b5366..0a2e2a3 100644 (file)
@@ -1,7 +1,7 @@
 {
   "name": "osm-lw-ui",
   "authors": [
-    "Francesco Lombardo <flombardo@cnit.it>"
+    "Francesco Lombardo <lombardo@everyup.it>"
   ],
   "description": "OSM Light UI",
   "main": "",
index d80d18d..45120e2 100644 (file)
@@ -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'))
index fa4117e..ad7072e 100644 (file)
@@ -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: