littlechef icon indicating copy to clipboard operation
littlechef copied to clipboard

AttributeError if http_proxy or https_proxy are missing

Open kylegibson opened this issue 10 years ago • 2 comments

The documentation says that I only need to set http_proxy or https_proxy if I'm using a proxy. However, I get the following traceback when trying to deploy:

  File "/home/vagrant/PolicyStat/pstat/pstat_deploy/provisioners/pstat/littlechef_provisioner.py", line 34, in do_first_launch_config
    lc.deploy_chef(ask="no", version=self.version, method=self.method)
  File "/home/vagrant/env/lib/python2.6/site-packages/littlechef/runner.py", line 218, in deploy_chef
    solo.configure()
  File "/home/vagrant/env/lib/python2.6/site-packages/littlechef/solo.py", line 105, in configure
    'https_proxy': env.https_proxy
  File "/home/vagrant/env/lib/python2.6/site-packages/fabric/utils.py", line 193, in __getattr__
    raise AttributeError(key)
AttributeError: https_proxy

https://github.com/tobami/littlechef/blob/master/littlechef/solo.py#L104

I was able to work around this issue by setting them both to blank.

from littlechef import runner as lc
...
lc.env.http_proxy = ''
lc.env.https_proxy = ''
lc.deploy_chef(ask="no", method='omnibus')

kylegibson avatar Nov 18 '14 19:11 kylegibson

That must be a bug that only appears when you use it as a library, instead of from the command line.

tobami avatar Nov 19 '14 09:11 tobami

This should be fixed with 1ef3df7 on my repo. I will request pull up tomorrow but I'm afraid that with so many changes it might be difficult.

On Tue, Nov 18, 2014 at 8:49 PM, Kyle Gibson [email protected] wrote:

The documentation says that I only need to set http_proxy or https_proxy if I'm using a proxy. However, I get the following traceback when trying to deploy:

File "/home/vagrant/PolicyStat/pstat/pstat_deploy/provisioners/pstat/littlechef_provisioner.py", line 34, in do_first_launch_config lc.deploy_chef(ask="no", version=self.version, method=self.method) File "/home/vagrant/env/lib/python2.6/site-packages/littlechef/runner.py", line 218, in deploy_chef solo.configure() File "/home/vagrant/env/lib/python2.6/site-packages/littlechef/solo.py", line 105, in configure 'https_proxy': env.https_proxy File "/home/vagrant/env/lib/python2.6/site-packages/fabric/utils.py", line 193, in getattr raise AttributeError(key) AttributeError: https_proxy

https://github.com/tobami/littlechef/blob/master/littlechef/solo.py#L104

I was able to work around this issue by setting them both to blank.

from littlechef import runner as lc ... lc.env.http_proxy = '' lc.env.https_proxy = '' lc.deploy_chef(ask="no", method='omnibus')

— Reply to this email directly or view it on GitHub https://github.com/tobami/littlechef/issues/222.

Regards.

Adam

haad avatar Nov 22 '14 22:11 haad