From: montesmoreno Date: Thu, 30 Mar 2017 11:24:17 +0000 (+0200) Subject: Minor changes to allow SDN connectivity for RO X-Git-Tag: v2.0.0~29 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fopenvim.git;a=commitdiff_plain;h=928275586b85630582bae0a480491c54b50421f5 Minor changes to allow SDN connectivity for RO Change-Id: Iaa947aeabe51ce015a3627685c7ee4bae1a36833 Signed-off-by: montesmoreno --- diff --git a/openflow_thread.py b/openflow_thread.py index 6b25dab..cd873e7 100644 --- a/openflow_thread.py +++ b/openflow_thread.py @@ -272,14 +272,14 @@ class openflow_thread(threading.Thread): if vlan_tag == None: vlan_tag=True elif vlan_tag==False: - text="Passthrough and external port vlan-tagged can not be connected when flag 'of_controller_nets_with_same_vlan' is True" + text="Passthrough and external port vlan-tagged cannot be connected when flag 'of_controller_nets_with_same_vlan' is True" #print self.name, "Error", text return -1, text else: if vlan_tag == None: vlan_tag=False elif vlan_tag == True: - text="SR-IOV and external port not vlan-tagged can not be connected when flag 'of_controller_nets_with_same_vlan' is True" + text="SR-IOV and external port not vlan-tagged cannot be connected when flag 'of_controller_nets_with_same_vlan' is True" #print self.name, "Error", text return -1, text elif port["model"]=="PF" or port["model"]=="VFnotShared": @@ -449,7 +449,7 @@ class openflow_thread(threading.Thread): if vlan_in == None and src_port['vlan'] != None: vlan_in = src_port['vlan'] elif vlan_in != None and src_port['vlan'] != None: - #TODO this is something that we can not do. It requires a double VLAN check + #TODO this is something that we cannot do. It requires a double VLAN check #outer VLAN should be src_port['vlan'] and inner VLAN should be vlan_in continue @@ -473,7 +473,7 @@ class openflow_thread(threading.Thread): if vlan_out == None and dst_port['vlan'] != None: vlan_out = dst_port['vlan'] elif vlan_out != None and dst_port['vlan'] != None: - #TODO this is something that we can not do. It requires a double VLAN set + #TODO this is something that we cannot do. It requires a double VLAN set #outer VLAN should be dst_port['vlan'] and inner VLAN should be vlan_out continue #if src_port == dst_port: @@ -530,7 +530,7 @@ class openflow_thread(threading.Thread): final_actions.append( ('vlan', action[0]) ) previous_vlan = action[0] if self.pmp_with_same_vlan and action_number: - return -1, "Can not interconnect different vlan tags in a network when flag 'of_controller_nets_with_same_vlan' is True." + return -1, "Cannot interconnect different vlan tags in a network when flag 'of_controller_nets_with_same_vlan' is True." action_number += 1 final_actions.append( ('out', action[1]) ) flow_broadcast['actions'] = final_actions diff --git a/ovim.py b/ovim.py index 06ee50a..83a9742 100644 --- a/ovim.py +++ b/ovim.py @@ -394,10 +394,11 @@ class ovim(): """ # create openflow thread - if 'of_controller_nets_with_same_vlan' in self.config: - ofc_net_same_vlan = self.config['of_controller_nets_with_same_vlan'] - else: - ofc_net_same_vlan = False + #if 'of_controller_nets_with_same_vlan' in self.config: + # ofc_net_same_vlan = self.config['of_controller_nets_with_same_vlan'] + #else: + # ofc_net_same_vlan = False + ofc_net_same_vlan = False thread = oft.openflow_thread(ofc_uuid, of_conn, of_test=self.of_test_mode, db=self.db_of, db_lock=self.db_lock, pmp_with_same_vlan=ofc_net_same_vlan, debug=self.config['log_level_of']) diff --git a/vim_db.py b/vim_db.py index d6ac871..ce19cf6 100644 --- a/vim_db.py +++ b/vim_db.py @@ -153,7 +153,7 @@ class vim_db(): return -HTTP_Conflict, "Value %s already in use for %s" % (e.args[1][de+15:fk], e.args[1][fk+7:]) if uk>=0: if wc>=0: - return -HTTP_Bad_Request, "Field %s can not be used for filtering" % e.args[1][uk+14:wc] + return -HTTP_Bad_Request, "Field %s cannot be used for filtering" % e.args[1][uk+14:wc] if fl>=0: return -HTTP_Bad_Request, "Field %s does not exist" % e.args[1][uk+14:wc] return -HTTP_Internal_Server_Error, "Database internal Error %d: %s" % (e.args[0], e.args[1]) @@ -1176,7 +1176,7 @@ class vim_db(): self.cur = self.con.cursor() match_found = False if len(valid_hosts)<=0: - error_text = 'No room at data center. Can not find a host with %s MB memory and %s cpus available' % (str(requirements['ram']), str(requirements['vcpus'])) + error_text = 'No room at data center. Cannot find a host with %s MB memory and %s cpus available' % (str(requirements['ram']), str(requirements['vcpus'])) #self.logger.debug(error_text) return -1, error_text @@ -1190,7 +1190,7 @@ class vim_db(): self.cur.close() self.cur = self.con.cursor() if len(valid_for_memory)<=0: - error_text = 'No room at data center. Can not find a host with %s GB Hugepages memory available' % str(requirements['numa']['memory']) + error_text = 'No room at data center. Cannot find a host with %s GB Hugepages memory available' % str(requirements['numa']['memory']) #self.logger.debug(error_text) return -1, error_text @@ -1210,7 +1210,7 @@ class vim_db(): self.cur.close() self.cur = self.con.cursor() if len(valid_for_processor)<=0: - error_text = 'No room at data center. Can not find a host with %s %s available' % (str(requirements['numa']['proc_req_nb']),cpu_requirement_text) + error_text = 'No room at data center. Cannot find a host with %s %s available' % (str(requirements['numa']['proc_req_nb']),cpu_requirement_text) #self.logger.debug(error_text) return -1, error_text @@ -1237,7 +1237,7 @@ class vim_db(): else: valid_numas.append(m_numa['numa_id']) if len(valid_numas)<=0: - error_text = 'No room at data center. Can not find a host with %s MB hugepages memory and %s %s available in the same numa' %\ + error_text = 'No room at data center. Cannot find a host with %s MB hugepages memory and %s %s available in the same numa' %\ (requirements['numa']['memory'], str(requirements['numa']['proc_req_nb']),cpu_requirement_text) #self.logger.debug(error_text) return -1, error_text @@ -1350,7 +1350,7 @@ class vim_db(): break if not match_found: - error_text = 'No room at data center. Can not find a host with the required hugepages, vcpus and interfaces' + error_text = 'No room at data center. Cannot find a host with the required hugepages, vcpus and interfaces' #self.logger.debug(error_text) return -1, error_text @@ -1709,9 +1709,9 @@ class vim_db(): if net['tenant_id']==tenant_id and net['shared']=='false': return -1, "needed admin privileges to attach to the net %s" % net_id #check types - if (net['type'] in ('p2p','data') and port_type != 'instance:data') or \ + if (net['type'] in ('ptp','data') and port_type not in ('instance:data','external')) or \ (net['type'] in ('bridge_data','bridge_man') and port_type not in ('instance:bridge', 'instance:ovs')): - return -1, "can not attach a port of type %s into a net of type %s" % (port_type, net['type']) + return -1, "Cannot attach a port of type %s into a net of type %s" % (port_type, net['type']) if net['type'] == 'ptp': #look how many nb_ports, data = self.get_ports( {'net_id':net_id} )