def __init__(self): auth_composite = self.networking_auth_composite() self.url = auth_composite.networking_url self.user = auth_composite._auth_user_config self.config = NetworkingBaseConfig() self.networks = NetworksComposite(auth_composite) self.subnets = SubnetsComposite(auth_composite) self.ports = PortsComposite(auth_composite) self.common = NetworkingCommonComposite() # Parent behavior can be used directly with parent config values self.common.behaviors = self.common.behavior_class() self.networks.behaviors = self.networks.behavior_class( networks_client=self.networks.client, networks_config=self.networks.config) self.subnets.behaviors = self.subnets.behavior_class( subnets_client=self.subnets.client, subnets_config=self.subnets.config) self.ports.behaviors = self.ports.behavior_class( ports_client=self.ports.client, ports_config=self.ports.config) # Integrates all behaviors for helper methods self.behaviors = NetworkingBehaviors( networks_behaviors=self.networks.behaviors, subnets_behaviors=self.subnets.behaviors, ports_behaviors=self.ports.behaviors)
def __init__(self, networks_behaviors, subnets_behaviors, ports_behaviors): super(NetworkingBehaviors, self).__init__() self.config = NetworkingBaseConfig() self.networks_config = networks_behaviors.config self.networks_client = networks_behaviors.client self.subnets_client = subnets_behaviors.client self.subnets_config = subnets_behaviors.config self.ports_client = ports_behaviors.client self.ports_config = ports_behaviors.config self.networks_behaviors = networks_behaviors self.subnets_behaviors = subnets_behaviors self.ports_behaviors = ports_behaviors
def __init__(self, networks_behaviors, subnets_behaviors, ports_behaviors): super(NetworkingBehaviors, self).__init__() self.config = NetworkingBaseConfig() self.networks_config = networks_behaviors.config self.networks_client = networks_behaviors.client self.subnets_client = subnets_behaviors.client self.subnets_config = subnets_behaviors.config self.ports_client = ports_behaviors.client self.ports_config = ports_behaviors.config self.networks_behaviors = networks_behaviors self.subnets_behaviors = subnets_behaviors self.ports_behaviors = ports_behaviors if self.config.use_compute_api: self.compute = ComputeComposite() else: self.compute = None self.error_msg = ('{message}: {status} {reason} {content}. ' 'Expected status code {expected_status}')
def __init__(self): super(NetworkingBaseBehaviors, self).__init__() self.config = NetworkingBaseConfig()