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

2015.5.0 modules/archive.py ZipFile instance has no attribute '__exit__' - only python 2.6? #23734

Closed
bradthurber opened this issue May 14, 2015 · 4 comments
Labels
Bug broken, incorrect, or confusing behavior Execution-Module fixed-pls-verify fix is linked, bug author to confirm fix P3 Priority 3 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@bradthurber
Copy link
Contributor

Got this error unzipping a .zip file using archive.extracted on 2015.5.0

    Function: archive.extracted
        Name: /opt/jboss/eap
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python2.6/site-packages/salt/state.py", line 1563, in call
                  **cdata['kwargs'])
                File "/usr/lib/python2.6/site-packages/salt/states/archive.py", line 178, in extracted
                  name)
                File "/usr/lib/python2.6/site-packages/salt/modules/archive.py", line 543, in unzip
                  'Exception encountered unpacking zipfile: {0}'.format(exc)
              CommandExecutionError: Exception encountered unpacking zipfile: ZipFile instance has no attribute '__exit__'
     Started: 18:52:10.869057
    Duration: 19.57 ms

This is a CentOS 6.5 system (python 2.6)

salt-minion --versions
           Salt: 2015.5.0
         Python: 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
         Jinja2: unknown
       M2Crypto: 0.20.2
 msgpack-python: 0.4.6
   msgpack-pure: Not Installed
       pycrypto: 2.0.1
        libnacl: Not Installed
         PyYAML: 3.10
          ioflo: Not Installed
          PyZMQ: 14.3.1
           RAET: Not Installed
            ZMQ: 3.2.5
           Mako: Not Installed

These links show what may be the problem and possible solutions
http://stackoverflow.com/questions/21268470/making-python-2-7-code-run-with-python-2-6
http://hsmoore.com/python-attributeerror-zipfile-instance-has-no-attribute-__exit__/

@bradthurber
Copy link
Contributor Author

I'm working on a possible PR to fix this

@rallytime
Copy link
Contributor

Thanks for the report and for the fix @bradthurber! Since your fix was merged, do you consider this issue ready to be closed?

@rallytime rallytime added Execution-Module Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around fixed-pls-verify fix is linked, bug author to confirm fix P3 Priority 3 labels May 14, 2015
@rallytime rallytime added this to the Approved milestone May 14, 2015
rallytime pushed a commit to rallytime/salt that referenced this issue May 14, 2015
@bradthurber
Copy link
Contributor Author

yes - it can be closed

Brad Thurber

On Thu, May 14, 2015 at 7:17 PM, Nicole Thomas notifications@github.com
wrote:

Thanks for the report and for the fix @bradthurber
https://github.com/bradthurber! Since your fix was merged, do you
consider this issue ready to be closed?


Reply to this email directly or view it on GitHub
#23734 (comment).

@rallytime
Copy link
Contributor

Super!

@jfindlay jfindlay added the Platform Relates to OS, containers, platform-based utilities like FS, system based apps label May 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Execution-Module fixed-pls-verify fix is linked, bug author to confirm fix P3 Priority 3 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

No branches or pull requests

3 participants