RIFT-14581, RIFT-14582 27/327/1
authorLaurence Maultsby <laurence.maultsby@riftio.com>
Wed, 14 Sep 2016 14:11:24 +0000 (10:11 -0400)
committerLaurence Maultsby <laurence.maultsby@riftio.com>
Wed, 14 Sep 2016 14:11:24 +0000 (10:11 -0400)
Signed-off-by: Laurence Maultsby <laurence.maultsby@riftio.com>
skyquake/plugins/config/src/dashboard/configStore.js
skyquake/plugins/launchpad/src/instantiate/instantiateInputParams.jsx
skyquake/plugins/launchpad/src/instantiate/instantiateStore.js

index 50a2cb7..675f3d6 100644 (file)
@@ -118,7 +118,7 @@ export default class AccountStore {
     }
     getResourceOrchestratorSuccess = (data) => {
         this.alt.actions.global.hideScreenLoader.defer();
-        if(data.hasOwnProperty('empty')) {
+        if(data && data.hasOwnProperty('empty')) {
             this.setAccountTemplate(false)
         } else {
             this.setState({
index 87c9592..5f1cc8a 100644 (file)
@@ -73,7 +73,7 @@ export default class InstantiateInputParams extends Component {
                     !isOpenMano(props.ro) ?
                       (
                         <label>Select VIM Account
-                          <SelectOption options={constructCloudAccountOptions(props.cloudAccounts)} initial={true} onChange={props.vnfFn.updateSelectedCloudAccount.bind(v['member-vnf-index'])} defaultValue={defaultValue} />
+                          <SelectOption options={constructCloudAccountOptions(props.cloudAccounts)} initial={true} onChange={props.vnfFn.updateSelectedCloudAccount.bind(null, v['member-vnf-index'])} defaultValue={defaultValue} />
                         </label>
                       )
                     : null
index 6b7941e..7d98079 100644 (file)
@@ -282,7 +282,7 @@ class LaunchNetworkServiceStore {
             updateSelectedCloudAccount: (cloudAccount) => {
                 let nsd = self.nsd[0];
                 var newState = {
-                    selectedCloudAccount: cloudAccount
+                    selectedCloudAccount: JSON.parse(cloudAccount.target.value)
                 };
                 if (cloudAccount['account-type'] == 'openstack') {
                     newState.displayPlacementGroups = true;
@@ -372,7 +372,7 @@ class LaunchNetworkServiceStore {
                     if(!vnfCA.hasOwnProperty(id)) {
                         vnfCA[id] = {};
                     }
-                    vnfCA[id].account = cloudAccount;
+                    vnfCA[id].account = JSON.parse(cloudAccount.target.value);
 
                     if (cloudAccount['account-type'] == 'openmano' && this.dataCenters && self.dataCenters[cloudAccount['name']]) {
                         let datacenter = self.dataCenters[cloudAccount['name']][0];
@@ -759,7 +759,9 @@ class LaunchNetworkServiceStore {
             if(vnfdCloudAccounts[k].hasOwnProperty('datacenter')) {
                 vnf['om-datacenter'] = vnfdCloudAccounts[k].datacenter;
             }
-            payload['vnf-cloud-account-map'].push(vnf);
+            if(vnf['om-datacenter'] || vnf['cloud-account'] || vnf['config-agent-account']) {
+                payload['vnf-cloud-account-map'].push(vnf);
+            }
         }
         //Add SSH-Keys
         payload['ssh-authorized-key'] = this.state.sshKeysRef.map(function(k) {