def test_plugins(self):
    'Test that plugins without dependencies work'
    localrc = {'test_localrc': '1'}
    local_conf = {'install': {'nova.conf': {'main': {'test_conf': '2'}}}}
    services = {'cinder': True}
    plugins = OrderedDict([('bar', 'git://git.openstack.org/openstack/bar-plugin'), ('foo', 'git://git.openstack.org/openstack/foo-plugin'), ('baz', 'git://git.openstack.org/openstack/baz-plugin')])
    p = dict(localrc=localrc, local_conf=local_conf, base_services=[], services=services, plugins=plugins, base_dir='./test', path=os.path.join(self.tmpdir, 'test.local.conf'))
    lc = LocalConf(p.get('localrc'), p.get('local_conf'), p.get('base_services'), p.get('services'), p.get('plugins'), p.get('base_dir'), p.get('projects'), p.get('project'))
    lc.write(p['path'])
    plugins = []
    with open(p['path']) as f:
        for line in f:
            if line.startswith('enable_plugin'):
                plugins.append(line.split()[1])
    self.assertEqual(['bar', 'baz', 'foo'], plugins)
Test that plugins without dependencies work
def test_plugins(self):
    
    localrc = {'test_localrc': '1'}
    local_conf = {'install': {'nova.conf': {'main': {'test_conf': '2'}}}}
    services = {'cinder': True}
    plugins = OrderedDict([('bar', 'git://git.openstack.org/openstack/bar-plugin'), ('foo', 'git://git.openstack.org/openstack/foo-plugin'), ('baz', 'git://git.openstack.org/openstack/baz-plugin')])
    p = dict(localrc=localrc, local_conf=local_conf, base_services=[], services=services, plugins=plugins, base_dir='./test', path=os.path.join(self.tmpdir, 'test.local.conf'))
    lc = LocalConf(p.get('localrc'), p.get('local_conf'), p.get('base_services'), p.get('services'), p.get('plugins'), p.get('base_dir'), p.get('projects'), p.get('project'))
    lc.write(p['path'])
    plugins = []
    with open(p['path']) as f:
        for line in f:
            if line.startswith('enable_plugin'):
                plugins.append(line.split()[1])
    self.assertEqual(['bar', 'baz', 'foo'], plugins)