Skip to content

Commit

Permalink
Merge pull request #85 from cloudblue/fix-import-initial-version
Browse files Browse the repository at this point in the history
Fix for initial version import
  • Loading branch information
marcserrat authored Apr 15, 2020
2 parents 9dbe166 + c87da09 commit 1c55077
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19.3
19.4
19 changes: 2 additions & 17 deletions apsconnectcli/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import json
import re
import sys
import uuid

from xml.etree import ElementTree as xml_et

Expand Down Expand Up @@ -242,22 +241,6 @@ def create_instance(self, package, oauth_key, oauth_secret, backend_url, setting
},
}

if 'hubId' in package.app_properties:
if not self.hub_id and not hub_id:
raise Exception("Core OA resource is not found\n"
"Use --hub-id={value} argument to specify the ID "
"manually or --hub-id=auto to generate it automatically")
elif self.hub_id:
hub_id = self.hub_id
elif hub_id == 'auto':
hub_id = str(uuid.uuid4())

payload.update({
'app': {
'hubId': hub_id
}
})

payload.update(settings)

r = self.aps.post('aps/2/applications/', json=payload)
Expand Down Expand Up @@ -658,6 +641,8 @@ def get_application_id(self, package_id):
r = self.osaapi.aps.getApplications(**payload)
osaapi_raise_for_status(r)

if len(r['result']) == 0:
return None
return r['result'][0]['application_id'] or None

def get_application_instances(self, application_id):
Expand Down

0 comments on commit 1c55077

Please sign in to comment.