Browse Source

Fix patching of create instance dialog (part trois)

Previous patch fixed the form but did not fix yet
another bug in the original implementation of the
patching of the create instance workflow. Namely,
the patched logic was always assuming the need for
a PTG, and would override the supplied network
arguments. This is being fixed here.

Also caps the cmd2 dependency whose latest version is
incompatible.

Change-Id: If0fff67cd2b811853a632055d1609b6057769bb8
Sumit Naiksatam 10 months ago
parent
commit
9ddc2346a0
2 changed files with 13 additions and 5 deletions
  1. 12
    5
      gbpui/panels/policytargets/restApi.py
  2. 1
    0
      test-requirements.txt

+ 12
- 5
gbpui/panels/policytargets/restApi.py View File

@@ -114,7 +114,7 @@ class Members(generic.View):
114 114
         'block_device_mapping_v2',
115 115
         'availability_zone',
116 116
         'admin_pass', 'disk_config',
117
-        'config_drive'
117
+        'config_drive', "scheduler_hints"
118 118
     ]
119 119
 
120 120
     @rest_utils.ajax()
@@ -153,10 +153,17 @@ class Members(generic.View):
153 153
         try:
154 154
             instance_name = request.DATA['name'] + suffix
155 155
 
156
-            meta_data, nics = self.create_ports(request, instance_name)
157
-
158
-            kw['meta'] = meta_data
159
-            kw['nics'] = nics
156
+            if "group_policy_targets" in request.DATA and (
157
+                    request.DATA["group_policy_targets"]):
158
+                meta_data, nics = self.create_ports(request, instance_name)
159
+
160
+                kw['meta'] = meta_data
161
+                kw['nics'] = nics
162
+            else:
163
+                if 'nics' in request.DATA:
164
+                    kw['nics'] = request.DATA['nics']
165
+                if 'meta' in request.DATA:
166
+                    kw['meta'] = request.DATA['meta']
160 167
 
161 168
             args = (
162 169
                 request,

+ 1
- 0
test-requirements.txt View File

@@ -11,6 +11,7 @@
11 11
 -e git://github.com/openstack/horizon.git@stable/pike#egg=horizon
12 12
 hacking<0.11,>=0.10.0
13 13
 #
14
+cmd2<0.9.0
14 15
 coverage!=4.4,>=4.0 # Apache-2.0
15 16
 django-nose>=1.4.4 # BSD
16 17
 mock>=2.0 # BSD

Loading…
Cancel
Save