tempest/scenario/manager.py
def _create_security_group_rule(self, client=None, secgroup=None,
                                    tenant_id=None, **kwargs):
        """Create a rule from a dictionary of rule parameters.

        Create a rule in a secgroup. if secgroup not defined will search for
        default secgroup in tenant_id.

        :param secgroup: type DeletableSecurityGroup.
        :param secgroup_id: search for secgroup by id
            default -- choose default secgroup for given tenant_id
        :param tenant_id: if secgroup not passed -- the tenant in which to
            search for default secgroup
        :param kwargs: a dictionary containing rule parameters:
            for example, to allow incoming ssh:
            rule = {
                    direction: 'ingress'
                    protocol:'tcp',
                    port_range_min: 22,
                    port_range_max: 22
                    }
        """
        if client is None:
            client = self.network_client
        if secgroup is None:
            secgroup = self._default_security_group(tenant_id)

        ruleset = dict(security_group_id=secgroup.id,
                       tenant_id=secgroup.tenant_id,
                       )
        ruleset.update(kwargs)

        body = dict(security_group_rule=dict(ruleset))
        sg_rule = client.create_security_group_rule(body=body)
        sg_rule = net_common.DeletableSecurityGroupRule(
            client=client,
            **sg_rule['security_group_rule']
        )
        self.set_resource(sg_rule.id, sg_rule)
        self.assertEqual(secgroup.tenant_id, sg_rule.tenant_id)
        self.assertEqual(secgroup.id, sg_rule.security_group_id)

        return sg_rule
Create a rule from a dictionary of rule parameters.

        Create a rule in a secgroup. if secgroup not defined will search for
        default secgroup in tenant_id.

        :param secgroup: type DeletableSecurityGroup.
        :param secgroup_id: search for secgroup by id
            default -- choose default secgroup for given tenant_id
        :param tenant_id: if secgroup not passed -- the tenant in which to
            search for default secgroup
        :param kwargs: a dictionary containing rule parameters:
            for example, to allow incoming ssh:
            rule = {
                    direction: 'ingress'
                    protocol:'tcp',
                    port_range_min: 22,
                    port_range_max: 22
                    }
        
Create a rule from a dictionary of rule parameters.
Create a rule in a secgroup. if secgroup not defined will search for
default secgroup in tenant_id.
Create a rule from a dictionary of rule parameters . Create a rule in a secgroup . if secgroup not defined will search for default secgroup in tenant_id .
def _create_security_group_rule(self, client=None, secgroup=None,
                                    tenant_id=None, **kwargs):
        if client is None:
            client = self.network_client
        if secgroup is None:
            secgroup = self._default_security_group(tenant_id)
        ruleset = dict(security_group_id=secgroup.id,
                       tenant_id=secgroup.tenant_id,
                       )
        ruleset.update(kwargs)
        body = dict(security_group_rule=dict(ruleset))
        sg_rule = client.create_security_group_rule(body=body)
        sg_rule = net_common.DeletableSecurityGroupRule(
            client=client,
            **sg_rule['security_group_rule']
        )
        self.set_resource(sg_rule.id, sg_rule)
        self.assertEqual(secgroup.tenant_id, sg_rule.tenant_id)
        self.assertEqual(secgroup.id, sg_rule.security_group_id)
        return sg_rule
def _create_security_group_rule ( self , client = None , secgroup = None , tenant_id = None , ** kwargs ) : if client is None : client = self . network_client if secgroup is None : secgroup = self . _default_security_group ( tenant_id ) ruleset = dict ( security_group_id = secgroup . id , tenant_id = secgroup . tenant_id , ) ruleset . update ( kwargs ) body = dict ( security_group_rule = dict ( ruleset ) ) sg_rule = client . create_security_group_rule ( body = body ) sg_rule = net_common . DeletableSecurityGroupRule ( client = client , ** sg_rule [ 'security_group_rule' ] ) self . set_resource ( sg_rule . id , sg_rule ) self . assertEqual ( secgroup . tenant_id , sg_rule . tenant_id ) self . assertEqual ( secgroup . id , sg_rule . security_group_id ) return sg_rule
Create a rule from a dictionary of rule parameters.
Create a rule from a dictionary of rule parameters .
"""Create a rule from a dictionary of rule parameters.

        Create a rule in a secgroup. if secgroup not defined will search for
        default secgroup in tenant_id.

        :param secgroup: type DeletableSecurityGroup.
        :param secgroup_id: search for secgroup by id
            default -- choose default secgroup for given tenant_id
        :param tenant_id: if secgroup not passed -- the tenant in which to
            search for default secgroup
        :param kwargs: a dictionary containing rule parameters:
            for example, to allow incoming ssh:
            rule = {
                    direction: 'ingress'
                    protocol:'tcp',
                    port_range_min: 22,
                    port_range_max: 22
                    }
        """
self
client
secgroup
None
tenant_id
if secgroup not passed -- the tenant in which to
search for default secgroup
if secgroup not passed -- the tenant in which to search for default secgroup
secgroup_id
search for secgroup by id
default -- choose default secgroup for given tenant_id
search for secgroup by id default -- choose default secgroup for given tenant_id
kwargs
a dictionary containing rule parameters:
for example, to allow incoming ssh:
rule = {
direction: 'ingress'
protocol:'tcp',
port_range_min: 22,
port_range_max: 22
}
a dictionary containing rule parameters : for example to allow incoming ssh : rule = { direction : ' ingress ' protocol : ' tcp ' port_range_min : 22 port_range_max : 22 }