~ionutbalutoiu/charms/trusty/neutron-api/next

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/contrib/openstack/context.py

  • Committer: James Page
  • Date: 2014-06-24 11:05:17 UTC
  • Revision ID: james.page@ubuntu.com-20140624110517-7chb3mwca2mtnmlp
Resync helpers, add standard targets to Makefile

Show diffs side-by-side

added added

removed removed

Lines of Context:
507
507
        if self.network_manager == 'quantum':
508
508
            _file = '/etc/nova/quantum_plugin.conf'
509
509
        else:
510
 
            _file = '/etc/neutron/neutron_plugin.conf'
 
510
            _file = '/etc/nova/neutron_plugin.conf'
511
511
        with open(_file, 'wb') as out:
512
512
            out.write(self.plugin + '\n')
513
513
 
541
541
 
542
542
        return nvp_ctxt
543
543
 
 
544
    def n1kv_ctxt(self):
 
545
        driver = neutron_plugin_attribute(self.plugin, 'driver',
 
546
                                          self.network_manager)
 
547
        n1kv_config = neutron_plugin_attribute(self.plugin, 'config',
 
548
                                               self.network_manager)
 
549
        n1kv_ctxt = {
 
550
            'core_plugin': driver,
 
551
            'neutron_plugin': 'n1kv',
 
552
            'neutron_security_groups': self.neutron_security_groups,
 
553
            'local_ip': unit_private_ip(),
 
554
            'config': n1kv_config,
 
555
            'vsm_ip': config('n1kv-vsm-ip'),
 
556
            'vsm_username': config('n1kv-vsm-username'),
 
557
            'vsm_password': config('n1kv-vsm-password'),
 
558
            'restrict_policy_profiles': config(
 
559
                'n1kv_restrict_policy_profiles'),
 
560
        }
 
561
 
 
562
        return n1kv_ctxt
 
563
 
544
564
    def neutron_ctxt(self):
545
565
        if https():
546
566
            proto = 'https'
570
590
 
571
591
        if self.plugin == 'ovs':
572
592
            ctxt.update(self.ovs_ctxt())
573
 
        elif self.plugin == 'nvp':
 
593
        elif self.plugin in ['nvp', 'nsx']:
574
594
            ctxt.update(self.nvp_ctxt())
 
595
        elif self.plugin == 'n1kv':
 
596
            ctxt.update(self.n1kv_ctxt())
575
597
 
576
598
        alchemy_flags = config('neutron-alchemy-flags')
577
599
        if alchemy_flags: