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

jhbuild plugin: fix UnboundLocalError for chmod_path #1534

Merged
merged 2 commits into from
Sep 7, 2017

Conversation

lucyllewy
Copy link
Contributor

Move for-loop into the same scope as the variable chmod_path.

fixes: https://bugs.launchpad.net/snapcraft/+bug/1715507

  • Have you followed the guidelines for contributing?
  • Have you signed the CLA?
  • If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on bug reports?
  • If this is a new feature. Have you discussed the design on the forum?
  • Have you successfully run ./runtests.sh static?
  • Have you successfully run ./runtests.sh unit?

Failing test groups:

  • snapcraft.tests.sources.test_mercurial.MercurialDetailsTestCase
  • snapcraft.tests.test_deltas.BaseDeltaGenerationTestCase
  • snapcraft.tests.test_deltas_xdelta3.XDelta3TestCase
  • snapcraft.tests.commands.test_push.PushCommandDeltasTestCase

None of those touch the jhbuild plugin so I propose the merge anyway.


Move for-loop into the same scope as the variable `chmod_path`.
Copy link
Contributor

@come-maiz come-maiz left a comment

Choose a reason for hiding this comment

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

It would be great to have a unit test that covers this bug. We are a now running to get the next release out, and this plugin will be experimental for a few iterations. But do you have in mind how those unit tests would look like? Is that something you can do as a follow up?

Thanks @diddledan!

if not os.path.exists(filename):
continue
os.chown(filename, jhbuild_user, jhbuild_group)
for filename in glob.iglob('%s/**' % chmod_path, recursive=True):
Copy link
Contributor

Choose a reason for hiding this comment

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

now that we are here, could you please use .format instead of %?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@come-maiz come-maiz left a comment

Choose a reason for hiding this comment

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

+1

@sergiusens sergiusens changed the title Fix UnboundLocalError for chmod_path in jhbuild plugin jhbuild plugin: fix UnboundLocalError for chmod_path Sep 7, 2017
@sergiusens
Copy link
Collaborator

it is all green according to the link, just not updating here.

@sergiusens sergiusens merged commit 67089e0 into canonical:master Sep 7, 2017
kalikiana pushed a commit to kalikiana/snapcraft that referenced this pull request Sep 21, 2017
Move for-loop into the same scope as the variable `chmod_path`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants