Repository navigation
Closed
Labels
P1Priority 1RIoTRelates to integration with cloud providers, hypervisors, API-based services, etc.Salt-Cloudbugbroken, incorrect, or confusing behaviorseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone
Description
Using the cloudstack driver to create a single minion, the VM gets created & starts responding, but then salt-cloud borks out:
[DEBUG ] Sending event - data = {'host': u'<an ip>', 'name': 'dodacloud3', '_stamp': '2015-10-14T20:07:49.710208', 'event': 'dodacloud3 has been deployed at <an ip>'}
[INFO ] Salt installed on dodacloud3
[INFO ] Created Cloud VM 'dodacloud3'
[DEBUG ] 'dodacloud3' VM creation details:<snipped>
[DEBUG ] Sending event - data = {'profile': 'dodacloud-profile', 'event': 'created instance', '_stamp': '2015-10-14T20:07:49.792801', 'name': 'dodacloud3', 'provider': 'aurora-ams:cloudstack'}
[ERROR ] There was a profile error: global name '__opts__' is not defined
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/salt/cloud/cli.py", line 276, in run
self.config.get('names')
File "/usr/lib/python2.7/site-packages/salt/cloud/__init__.py", line 1403, in run_profile
ret[name] = self.create(vm_)
File "/usr/lib/python2.7/site-packages/salt/cloud/__init__.py", line 1260, in create
conf_path = '/'.join(__opts__['conf_file'].split('/')[:-1])
NameError: global name '__opts__' is not defined
That line reads:
# a small pause makes the sync work reliably
time.sleep(3)
mopts_ = salt.config.DEFAULT_MINION_OPTS
conf_path = '/'.join(__opts__['conf_file'].split('/')[:-1])
mopts_.update(
salt.config.minion_config(
os.path.join(conf_path,
'minion')
)
)
client = salt.client.get_local_client(mopts=mopts_)The one obvious remark here is: shouldn't it be something like os.path.dirname(__opts__['conf_file'])?
The other is; Shouldn't salt-cloud CLI provide it's own __opts__? Or is it supposed to be mopts_ that delivers conf_file?
Metadata
Metadata
Assignees
Labels
P1Priority 1RIoTRelates to integration with cloud providers, hypervisors, API-based services, etc.Salt-Cloudbugbroken, incorrect, or confusing behaviorseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around
Activity
[-]Salt-cloud 2015.8 borks out with global name '__opts__' is not defined [/-][+]Salt-cloud CLI 2015.8 borks out with global name '__opts__' is not defined [/+]techhat commentedon Oct 14, 2015
Looks like it should be
self.opts.The-Loeki commentedon Oct 14, 2015
Well, tested it here and that works too :D tnx