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

UnboundLocalError: local variable 'updated_data' refrenced before assignment #209

Closed
gerardweese opened this issue Nov 21, 2014 · 10 comments
Milestone

Comments

@gerardweese
Copy link

I'm receiving the following error when running Firefox.jss, or Evernote.jss and even tried Silveright.jss

"/Library/Python/2.7/site-packages/jss/jss.py", line 616 in save for child in updated_data.getchildren():
UnboundLocalError: local variable 'updated_data' refrenced before assignment

This seems similar to issue #175 but at a different point in the code. Autopkgr runs the .jss with no errors I only receive the above error when running {autopkg run -v nameofpackage.jss}

I get no new Policy, the process does appear to upload the packages to the CasperShare

edit: corrected details

@eahrold
Copy link
Collaborator

eahrold commented Nov 21, 2014

Do you have all of your dist points added?

@gerardweese
Copy link
Author

Yes, @eahrold If I don't add all my DP's I get the following error:
[UnboundLocalError: local variable 'password' referenced before assignment
which is like issue #175
I can confirm I get mounted access to both DP's once autopkgr runs
and based on previous testing you helped me with in https://github.com/jssimporter/JSSImporter/issues/9# by testing mount commands manually I know the DP's mount.

@eahrold
Copy link
Collaborator

eahrold commented Nov 21, 2014

@gerardweese I figured as much, I just always like to double check to start.
I'm not very experienced with casper, but from the code itself it looks like either a permission issue, or that the object getting updated is not mutable.

If you're feeling adventurous, you could try setting the updated_data on L594 or so it won't be unbound,

updated_data = None

See if that helps to just skips over the problem

@gerardweese
Copy link
Author

@eahrold I am adventurous and no unfortunately it did not resolve the issue. declaring updated_data on L594. python reported an unexpected indent.

I'm going to open the issue on the python.jss git page.

@eahrold
Copy link
Collaborator

eahrold commented Nov 21, 2014

@gerardweese, that's python for you... It's very fussy when it comes to indents.

you need to make sure there are exactly 8 spaces before the update_data = None which should put it in line with the first quote of the line before. Only spaces, no tabs.

@gerardweese
Copy link
Author

Yup, @eahrold just reading about this whitespace as a methodology for clean code.
I removed the tabs, added 8 spaces and now get
AttributeError: 'NoneType' object has no attribute 'getchildren'

@homebysix
Copy link
Collaborator

New versions of jss-autopkg-addon and python-jss are available. We'll have a new version of AutoPkgr available soon. When we do, it'd be great to know whether this fixes your issue.

@homebysix homebysix modified the milestone: 1.1.2 Nov 25, 2014
@homebysix
Copy link
Collaborator

@gerardweese — Could you try this again with 1.1.2?

@gerardweese
Copy link
Author

@homebysix I have tried with the newest version of Autopkgr and I'm now receiving the error in issue #178 It's not completely clear to my why. It could still be related ssl_.py issue documented here jssimporter/JSSImporter#9 which was originally resolved for me not sure why it's reoccured. I tried to recreate the solution for ssl_.py but that file is now mark as .old

@eahrold
Copy link
Collaborator

eahrold commented Dec 19, 2014

@gerardweese,
I'm going to close this again. If you're still having a similar issue feel free to open a new issue.
Thanks for your troubleshooting help.

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

No branches or pull requests

3 participants