Skip to content

Commit 1c55077

Browse files
authored
Merge pull request #85 from cloudblue/fix-import-initial-version
Fix for initial version import
2 parents 9dbe166 + c87da09 commit 1c55077

2 files changed

Lines changed: 3 additions & 18 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19.3
1+
19.4

apsconnectcli/hub.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import json
44
import re
55
import sys
6-
import uuid
76

87
from xml.etree import ElementTree as xml_et
98

@@ -242,22 +241,6 @@ def create_instance(self, package, oauth_key, oauth_secret, backend_url, setting
242241
},
243242
}
244243

245-
if 'hubId' in package.app_properties:
246-
if not self.hub_id and not hub_id:
247-
raise Exception("Core OA resource is not found\n"
248-
"Use --hub-id={value} argument to specify the ID "
249-
"manually or --hub-id=auto to generate it automatically")
250-
elif self.hub_id:
251-
hub_id = self.hub_id
252-
elif hub_id == 'auto':
253-
hub_id = str(uuid.uuid4())
254-
255-
payload.update({
256-
'app': {
257-
'hubId': hub_id
258-
}
259-
})
260-
261244
payload.update(settings)
262245

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

644+
if len(r['result']) == 0:
645+
return None
661646
return r['result'][0]['application_id'] or None
662647

663648
def get_application_instances(self, application_id):

0 commit comments

Comments
 (0)