Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allocate-ports: avoid failure on domain removal #7

Merged
merged 1 commit into from
Mar 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion imageroot/bin/allocate-ports
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ rdb.close() # close the read-only connection
if len(user_domain_changed_events) > 0:
with agent.redis_connect(privileged=True).pipeline() as trx:
trx.delete(f'{agent_id}/data/domain_port')
trx.hset(f'{agent_id}/data/domain_port', mapping=domain_port)
if domain_port:
trx.hset(f'{agent_id}/data/domain_port', mapping=domain_port)
for domevent in user_domain_changed_events:
trx.publish(f'{agent_id}/event/user-domain-changed', json.dumps(domevent))
trx.execute()
Expand Down