Skip to content

Commit

Permalink
create default org if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorquas committed Jan 29, 2025
1 parent 0554612 commit 78844bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion virtwho/provision/virtwho_satellite.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def satellite_deploy_for_virtwho(args):
default_org = "Default_Organization"
satellite.sca(org=None)
else:
satellite.org_create(name=default_org, label=default_org)
satellite.sca(org=default_org)

satellite_manifest_upload(
Expand Down
6 changes: 5 additions & 1 deletion virtwho/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,11 @@ def __init__(self, server=None, org=None, activation_key=None):
host=self.server, user=register.ssh_username, pwd=register.ssh_password
)
self.hammer = "hammer --output=json"
self.org_id = self.organization_id()
try:
self.org_id = self.organization_id()
except FailException: #retry by creating org first
self.org_create(name=self.org, label=self.org)
self.org_id = self.organization_id()
self.api = f"https://{self.server}"
self.auth = (register.username, register.password)

Expand Down

0 comments on commit 78844bc

Please sign in to comment.