Example #1
0
 def get_metadata_port_network(self, network):
     # TODO(twilson) This function should really just take a Row/RowView
     try:
         dp = self.lookup('Datapath_Binding', uuid.UUID(network))
     except idlutils.RowNotFound:
         return None
     cmd = self.db_find_rows('Port_Binding', ('datapath', '=', dp),
                             ('type', '=', 'localport'))
     return next(iter(cmd.execute(check_error=True)), None)
Example #2
0
 def get_chassis_data_for_ml2_bind_port(self, hostname):
     try:
         cmd = self.db_find_rows('Chassis', ('hostname', '=', hostname))
         chassis = next(c for c in cmd.execute(check_error=True))
     except StopIteration:
         msg = _('Chassis with hostname %s does not exist') % hostname
         raise RuntimeError(msg)
     return (chassis.external_ids.get('datapath-type', ''),
             chassis.external_ids.get('iface-types', ''),
             self._get_chassis_physnets(chassis))
Example #3
0
 def chassis_exists(self, hostname):
     cmd = self.db_find('Chassis', ('hostname', '=', hostname))
     return bool(cmd.execute(check_error=True))