def clone_http_policy_set(self, policy, prefix, avi_config, tenant_name, cloud_name, used_poolgrp_ref, userprefix=None):
    '\n        This function clone pool reused in context switching rule\n        :param policy: name of policy\n        :param prefix: clone for\n        :param avi_config: avi config dict\n        :param tenant_name:\n        :param cloud_name:\n        :param used_poolgrp_ref:\n        :param userprefix: prefix for objects\n        :return:None\n        '
    policy_name = policy['name']
    clone_policy = copy.deepcopy(policy)
    for rule in clone_policy['http_request_policy']['rules']:
        if (rule.get('switching_action', None) and rule['switching_action'].get('pool_group_ref')):
            pool_group_ref = rule['switching_action']['pool_group_ref'].split('&')[1].split('=')[1]
            if (pool_group_ref in used_poolgrp_ref):
                LOG.debug('Cloned the pool group for policy %s', policy_name)
                pool_group_ref = self.clone_pool_group(pool_group_ref, policy_name, avi_config, tenant_name, cloud_name, userprefix=userprefix)
            if pool_group_ref:
                updated_pool_group_ref = self.get_object_ref(pool_group_ref, OBJECT_TYPE_POOL_GROUP, tenant_name, cloud_name)
                rule['switching_action']['pool_group_ref'] = updated_pool_group_ref
    clone_policy['name'] += ('-%s-clone' % prefix)
    return clone_policy
This function clone pool reused in context switching rule
:param policy: name of policy
:param prefix: clone for
:param avi_config: avi config dict
:param tenant_name:
:param cloud_name:
:param used_poolgrp_ref:
:param userprefix: prefix for objects
:return:None
def clone_http_policy_set(self, policy, prefix, avi_config, tenant_name, cloud_name, used_poolgrp_ref, userprefix=None):
    '\n        This function clone pool reused in context switching rule\n        :param policy: name of policy\n        :param prefix: clone for\n        :param avi_config: avi config dict\n        :param tenant_name:\n        :param cloud_name:\n        :param used_poolgrp_ref:\n        :param userprefix: prefix for objects\n        :return:None\n        '
    policy_name = policy['name']
    clone_policy = copy.deepcopy(policy)
    for rule in clone_policy['http_request_policy']['rules']:
        if (rule.get('switching_action', None) and rule['switching_action'].get('pool_group_ref')):
            pool_group_ref = rule['switching_action']['pool_group_ref'].split('&')[1].split('=')[1]
            if (pool_group_ref in used_poolgrp_ref):
                LOG.debug('Cloned the pool group for policy %s', policy_name)
                pool_group_ref = self.clone_pool_group(pool_group_ref, policy_name, avi_config, tenant_name, cloud_name, userprefix=userprefix)
            if pool_group_ref:
                updated_pool_group_ref = self.get_object_ref(pool_group_ref, OBJECT_TYPE_POOL_GROUP, tenant_name, cloud_name)
                rule['switching_action']['pool_group_ref'] = updated_pool_group_ref
    clone_policy['name'] += ('-%s-clone' % prefix)
    return clone_policy