}
getResourceOrchestratorSuccess = (data) => {
this.alt.actions.global.hideScreenLoader.defer();
- if(data.hasOwnProperty('empty')) {
+ if(data && data.hasOwnProperty('empty')) {
this.setAccountTemplate(false)
} else {
this.setState({
!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
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;
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];
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) {