Skip to content

security_group.py: fix NameError: name 'd' is not defined#3641

Merged
yadvr merged 1 commit into
apache:masterfrom
ustcweizhou:security_group_error
Oct 22, 2019
Merged

security_group.py: fix NameError: name 'd' is not defined#3641
yadvr merged 1 commit into
apache:masterfrom
ustcweizhou:security_group_error

Conversation

@ustcweizhou

@ustcweizhou ustcweizhou commented Oct 17, 2019

Copy link
Copy Markdown
Contributor

Description

in agent.log on a host running with cloudstack 4.14.0.0-SNAPSHOT, it gives error

Traceback (most recent call last):
  File "/usr/share/cloudstack-common/scripts/vm/network/security_group.py", line 1272, in <module>
    get_rule_logs_for_vms()
  File "/usr/share/cloudstack-common/scripts/vm/network/security_group.py", line 758, in get_rule_logs_for_vms
    vms = virshlist(state)
  File "/usr/share/cloudstack-common/scripts/vm/network/security_group.py", line 104, in virshlist
    alldomains = [d for domain in map(conn.lookupByID, conn.listDomainsID())]
  File "/usr/share/cloudstack-common/scripts/vm/network/security_group.py", line 104, in <listcomp>
    alldomains = [d for domain in map(conn.lookupByID, conn.listDomainsID())]
NameError: name 'd' is not defined

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Screenshots (if appropriate):

How Has This Been Tested?

in agent.log on a host running with cloudstack 4.14.0.0-SNAPSHOT, it gives error

root@node212:~# /usr/share/cloudstack-common/scripts/vm/network/security_group.py get_rule_logs_for_vms
Traceback (most recent call last):
  File "/usr/share/cloudstack-common/scripts/vm/network/security_group.py", line 1272, in <module>
    get_rule_logs_for_vms()
  File "/usr/share/cloudstack-common/scripts/vm/network/security_group.py", line 758, in get_rule_logs_for_vms
    vms = virshlist(state)
  File "/usr/share/cloudstack-common/scripts/vm/network/security_group.py", line 104, in virshlist
    alldomains = [d for domain in map(conn.lookupByID, conn.listDomainsID())]
  File "/usr/share/cloudstack-common/scripts/vm/network/security_group.py", line 104, in <listcomp>
    alldomains = [d for domain in map(conn.lookupByID, conn.listDomainsID())]
NameError: name 'd' is not defined
@ustcweizhou

Copy link
Copy Markdown
Contributor Author

@wido
could you please review it ?

@wido
wido self-requested a review October 17, 2019 12:36

@wido wido left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@GabrielBrascher GabrielBrascher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM

@yadvr yadvr added this to the 4.14.0.0 milestone Oct 22, 2019
@yadvr

yadvr commented Oct 22, 2019

Copy link
Copy Markdown
Member

The changes are in SG related file that trillian doesn't test by default, can you share any confirmation of testing @ustcweizhou @wido @GabrielBrascher ?

@yadvr

yadvr commented Oct 22, 2019

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-326

@yadvr

yadvr commented Oct 22, 2019

Copy link
Copy Markdown
Member

Tested locally, the issue is pythonic iteration. LGTM.

@yadvr
yadvr merged commit 848860d into apache:master Oct 22, 2019
ustcweizhou added a commit to ustcweizhou/cloudstack that referenced this pull request Feb 28, 2020
in agent.log on a host running with cloudstack 4.14.0.0-SNAPSHOT, it gives error

root@node212:~# /usr/share/cloudstack-common/scripts/vm/network/security_group.py get_rule_logs_for_vms
Traceback (most recent call last):
  File "/usr/share/cloudstack-common/scripts/vm/network/security_group.py", line 1272, in <module>
    get_rule_logs_for_vms()
  File "/usr/share/cloudstack-common/scripts/vm/network/security_group.py", line 758, in get_rule_logs_for_vms
    vms = virshlist(state)
  File "/usr/share/cloudstack-common/scripts/vm/network/security_group.py", line 104, in virshlist
    alldomains = [d for domain in map(conn.lookupByID, conn.listDomainsID())]
  File "/usr/share/cloudstack-common/scripts/vm/network/security_group.py", line 104, in <listcomp>
    alldomains = [d for domain in map(conn.lookupByID, conn.listDomainsID())]
NameError: name 'd' is not defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants