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

Fix new container initialization in LXC runner #23311

Merged
merged 1 commit into from
May 4, 2015

Commits on May 4, 2015

  1. Fix new container initialization in LXC runner

    When creating new LXC container with help of salt-cloud lxc.init crashes
    with similar message:
    
    [INFO    ] Creating container(s) '['test-host']' on host 'lxc-host'
    [ERROR   ] Failed to create VM test-host. Configuration value 'test-host' needs to be set
    Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1193, in create
        output = self.clouds[func](vm_)
      File "/usr/lib/python2.7/dist-packages/salt/cloud/clouds/lxc.py", line 424, in create
        cret = _runner().cmd('lxc.cloud_init', [vm_['name']], kwarg=kwarg)
      File "/usr/lib/python2.7/dist-packages/salt/runner.py", line 123, in cmd
        return self.functions[fun](*args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/salt/runners/lxc.py", line 355, in cloud_init
        saltcloud_mode=True, quiet=quiet, **kwargs)
      File "/usr/lib/python2.7/dist-packages/salt/runners/lxc.py", line 257, in init
        kw['seed'] = seeds[name]
    KeyError: 'test-host'
    
    The reason is that salt-cloud always passes generated keys to lxc.init,
    it skips seeds dictionary population and errors out trying to lookup
    non-existent key.
    
    Fix this by using fallback value of True because we always want to seed
    minion in such case.
    cellscape committed May 4, 2015
    Configuration menu
    Copy the full SHA
    76fbb34 View commit details
    Browse the repository at this point in the history