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

boto_cloudfront update distribution fails #50073

Closed
jorotenev opened this issue Oct 16, 2018 · 1 comment

Comments

@jorotenev
Copy link

commented Oct 16, 2018

Description of Issue/Question

Updating a CloudFront distribution via the boto_cloudfront state fails due to a typo in the corresponding state file.
boto_cloudfront.py

The variable should be declared as distribution_result instead of distribution_ret.

Setup

(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)

cf_testgeorgi.blabla.com:
  boto_cloudfront.present:
    - name: testgeorgi.blabla.com_distribution
    - tags:
        salt_managed: "True"
    - config:
           <about 500 lines of config :) >

Steps to Reproduce Issue

(Include debug logs if possible and relevant.)

  • Create a distribution via the boto_cloudfront.present
  • Run the same state again, without chaning anything, so that the update_distribution() method is called
root@master-10-155:/var/cache/salt/minion/files/qa# salt '*master*' state.sls_id cf_testgeorgi.blabla.com wordpress.cloudfront
master-10-155.eu-west-1a.qa-public:
----------
          ID: cf_testgeorgi.blabla.com
    Function: boto_cloudfront.present
        Name: testgeorgi.blabla.com_distribution
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1905, in call
                  **cdata['kwargs'])
                File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1830, in wrapper
                  return f(*args, **kwargs)
                File "/usr/lib/python2.7/dist-packages/salt/states/boto_cloudfront.py", line 216, in present
                  profile=profile,
                File "/usr/lib/python2.7/dist-packages/salt/modules/boto_cloudfront.py", line 403, in update_distribution
                  if 'error' in distribution_result:
              NameError: global name 'distribution_result' is not defined
     Started: 11:04:14.782944
    Duration: 46474.37 ms
     Changes:

Versions Report

(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)

root@master-10-155:/var/cache/salt/minion/files/qa# salt --versions-report
Salt Version:
Salt: 2018.3.1

Dependency Versions:
cffi: Not Installed
cherrypy: 3.2.2
dateutil: 2.7.3
docker-py: Not Installed
gitdb: 0.5.4
gitpython: 0.3.2 RC1
ioflo: Not Installed
Jinja2: 2.7.2
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: 0.9.1
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: 1.2.3
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.6 (default, Oct 26 2016, 20:30:19)
python-gnupg: Not Installed
PyYAML: 3.13
PyZMQ: 14.0.1
RAET: Not Installed
smmap: 0.8.2
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5

System Versions:
dist: Ubuntu 14.04 trusty
locale: UTF-8
machine: x86_64
release: 3.13.0-116-generic
system: Linux
version: Ubuntu 14.04 trusty

@garethgreenaway

This comment has been minimized.

Copy link
Member

commented Jan 9, 2019

Closing this out, if the problem persists please comment & we'll re-open the issue or feel free to open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.