From 936d77c845a93a276f802948f68dd2075829da7f Mon Sep 17 00:00:00 2001 From: QiLiang Date: Wed, 21 Sep 2016 12:37:39 +0800 Subject: Remove unsed files in open-contrail role JIRA: - Change-Id: Idfb53a9705f206266c01be6d586e57e15280a1bc Signed-off-by: QiLiang --- .../open-contrail/files/provision/vif.py.patch | 91 ---------------------- 1 file changed, 91 deletions(-) delete mode 100755 deploy/adapters/ansible/roles/open-contrail/files/provision/vif.py.patch (limited to 'deploy/adapters/ansible/roles/open-contrail/files/provision/vif.py.patch') diff --git a/deploy/adapters/ansible/roles/open-contrail/files/provision/vif.py.patch b/deploy/adapters/ansible/roles/open-contrail/files/provision/vif.py.patch deleted file mode 100755 index 103f084a..00000000 --- a/deploy/adapters/ansible/roles/open-contrail/files/provision/vif.py.patch +++ /dev/null @@ -1,91 +0,0 @@ -*** a/vif.py Mon Sep 28 15:13:30 2015 ---- b/vif.py Mon Sep 28 15:21:30 2015 -*************** -*** 332,337 **** ---- 332,347 ---- - - return conf - -+ def get_config_vrouter(self, instance, vif, image_meta, -+ inst_type, virt_type): -+ conf = self.get_base_config(instance, vif, image_meta, -+ inst_type, virt_type) -+ dev = self.get_vif_devname(vif) -+ designer.set_vif_host_backend_ethernet_config(conf, dev) -+ -+ designer.set_vif_bandwidth_config(conf, inst_type) -+ return conf -+ - def get_config(self, instance, vif, image_meta, - inst_type, virt_type): - vif_type = vif['type'] -*************** -*** 526,531 **** ---- 536,580 ---- - except processutils.ProcessExecutionError: - LOG.exception(_LE("Failed while plugging vif"), instance=instance) - -+ def plug_vrouter(self, instance, vif): -+ """Plug into Contrail's network port -+ Bind the vif to a Contrail virtual port. -+ """ -+ dev = self.get_vif_devname(vif) -+ ip_addr = '0.0.0.0' -+ ip6_addr = None -+ subnets = vif['network']['subnets'] -+ for subnet in subnets: -+ if not subnet['ips']: -+ continue -+ ips = subnet['ips'][0] -+ if not ips['address']: -+ continue -+ if (ips['version'] == 4): -+ if ips['address'] is not None: -+ ip_addr = ips['address'] -+ if (ips['version'] == 6): -+ if ips['address'] is not None: -+ ip6_addr = ips['address'] -+ -+ ptype = 'NovaVMPort' -+ if (cfg.CONF.libvirt.virt_type == 'lxc'): -+ ptype = 'NameSpacePort' -+ -+ cmd_args = ("--oper=add --uuid=%s --instance_uuid=%s --vn_uuid=%s " -+ "--vm_project_uuid=%s --ip_address=%s --ipv6_address=%s" -+ " --vm_name=%s --mac=%s --tap_name=%s --port_type=%s " -+ "--tx_vlan_id=%d --rx_vlan_id=%d" % (vif['id'], -+ instance.uuid, vif['network']['id'], -+ instance.project_id, ip_addr, ip6_addr, -+ instance.display_name, vif['address'], -+ vif['devname'], ptype, -1, -1)) -+ try: -+ linux_net.create_tap_dev(dev) -+ utils.execute('vrouter-port-control', cmd_args, run_as_root=True) -+ except processutils.ProcessExecutionError: -+ LOG.exception(_LE("Failed while plugging vif"), instance=instance) -+ - def plug(self, instance, vif): - vif_type = vif['type'] - -*************** -*** 679,684 **** ---- 728,746 ---- - LOG.exception(_LE("Failed while unplugging vif"), - instance=instance) - -+ def unplug_vrouter(self, instance, vif): -+ """Unplug Contrail's network port -+ Unbind the vif from a Contrail virtual port. -+ """ -+ dev = self.get_vif_devname(vif) -+ cmd_args = ("--oper=delete --uuid=%s" % (vif['id'])) -+ try: -+ utils.execute('vrouter-port-control', cmd_args, run_as_root=True) -+ linux_net.delete_net_dev(dev) -+ except processutils.ProcessExecutionError: -+ LOG.exception( -+ _LE("Failed while unplugging vif"), instance=instance) -+ - def unplug(self, instance, vif): - vif_type = vif['type'] - -- cgit 1.2.3-korg