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

python api is error #8346

Closed
zhausong opened this issue Nov 8, 2013 · 4 comments
Closed

python api is error #8346

zhausong opened this issue Nov 8, 2013 · 4 comments
Labels
Bug broken, incorrect, or confusing behavior cannot-reproduce cannot be replicated with info/context provided
Milestone

Comments

@zhausong
Copy link
Contributor

zhausong commented Nov 8, 2013

salt version is

# salt-master  --versions-report
           Salt: 0.17.0
         Python: 2.6.6 (r266:84292, Jul 10 2013, 22:48:45)
         Jinja2: 2.7.1
       M2Crypto: 0.20.2
 msgpack-python: 0.1.13
   msgpack-pure: Not Installed
       pycrypto: 2.6
         PyYAML: 3.10
          PyZMQ: 2.2.0.1
            ZMQ: 3.2.3

Can't use salt api

In [1]: import salt.client

In [2]: salt.client.LocalClient()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)

/root/<ipython console> in <module>()

/usr/lib/python2.6/site-packages/salt/client/__init__.pyc in __init__(self, c_path, mopts)
     87             self.opts = mopts
     88         else:
---> 89             self.opts = salt.config.client_config(c_path)
     90         self.serial = salt.payload.Serial(self.opts)
     91         self.salt_user = self.__get_user()

/usr/lib/python2.6/site-packages/salt/config.pyc in client_config(path, env_var, defaults)
   1019     # path, salt's defaults or provided defaults

   1020     opts.update(
-> 1021         master_config(path, defaults=defaults)
   1022     )
   1023     # Update with the users salt dot file or with the environment variable


/usr/lib/python2.6/site-packages/salt/config.pyc in master_config(path, env_var, defaults)
    901     include = overrides.get('include', [])
    902 
--> 903     overrides.update(include_config(default_include, path, verbose=False))
    904     overrides.update(include_config(include, path, verbose=True))
    905     opts = apply_master_config(overrides, defaults)

/usr/lib/python2.6/site-packages/salt/config.pyc in include_config(include, orig_path, verbose)
    547         for fn_ in sorted(glob.glob(path)):
    548             log.debug('Including configuration from {0!r}'.format(fn_))
--> 549             configuration.update(_read_conf_file(fn_))
    550     return configuration
    551 

/usr/lib/python2.6/site-packages/salt/config.pyc in _read_conf_file(path)
    447         if 'id' in conf_opts:
    448             conf_opts['id'] = str(conf_opts['id'])
--> 449         for key, value in conf_opts.copy().iteritems():
    450             if isinstance(value, unicode):
    451                 # We do not want unicode settings


AttributeError: 'str' object has no attribute 'copy'
@whiteinge
Copy link
Contributor

That is a peculiar error. I can't reproduce it locally on v0.17.0.

What OS are you running? Is there anything unusual in your master config file, perhaps near the bottom?

@zhausong
Copy link
Contributor Author

zhausong commented Nov 9, 2013

@whiteinge
os
Linux 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
CentOS release 6.4 (Final)

master file is default
I use the epel source to yum install

# rpm -qa |grep salt
salt-minion-0.17.1-1.el6.noarch
salt-master-0.17.1-1.el6.noarch
salt-0.17.1-1.el6.noarch

this is not exist in 0.16 version,just in 0.17

@zhausong
Copy link
Contributor Author

zhausong commented Nov 9, 2013

@whiteinge I found the reason of the problem,because of the old version configuration file
mv /etc/salt/ /etc/salt_bak and reinstall salt, it was work ok.
Thanks!

@whiteinge
Copy link
Contributor

I'm glad you were able to track it down! Thanks for the update.

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 cannot-reproduce cannot be replicated with info/context provided
Projects
None yet
Development

No branches or pull requests

2 participants