def update_application_profile(self, profile_name, pki_profile_ref, tenant_ref, name, avi_config, sysdict):
    '\n        This functions defines to update application profile with pki profile if\n        application profile exist if not create new http profile with pki profile\n        :param profile_name: name of Http profile\n        :param pki_profile_ref:  ref of PKI profile\n        :param tenant_ref: tenant ref\n        :param name: name of virtual service\n        :param avi_config: Dict of AVi config\n        :param sysdict: baseline/system config\n        :return: Http profile\n        '
    try:
        if profile_name:
            app_profile = [p for p in (sysdict['ApplicationProfile'] + avi_config['ApplicationProfile']) if (p['name'] == profile_name)]
            if app_profile:
                app_profile[0]['http_profile']['pki_profile_ref'] = pki_profile_ref
                LOG.debug(('Added PKI profile to application profile successfully : %s' % (profile_name, pki_profile_ref)))
        else:
            app_profile = dict()
            app_profile['name'] = (name + ('-%s-%s' % (random.randrange(0, 1000), ns_constants.PLACE_HOLDER_STR)))
            app_profile['tenant_ref'] = tenant_ref
            app_profile['type'] = 'APPLICATION_PROFILE_TYPE_HTTP'
            http_profile = dict()
            http_profile['connection_multiplexing_enabled'] = False
            http_profile['xff_enabled'] = False
            http_profile['websockets_enabled'] = False
            http_profile['pki_profile_ref'] = pki_profile_ref
            app_profile['http_profile'] = http_profile
            avi_config['ApplicationProfile'].append(app_profile)
            LOG.debug(('Conversion completed successfully for httpProfile: %s' % app_profile['name']))
            return app_profile['name']
    except:
        update_count('error')
        LOG.error('Error in convertion of httpProfile', exc_info=True)
This functions defines to update application profile with pki profile if
application profile exist if not create new http profile with pki profile
:param profile_name: name of Http profile
:param pki_profile_ref:  ref of PKI profile
:param tenant_ref: tenant ref
:param name: name of virtual service
:param avi_config: Dict of AVi config
:param sysdict: baseline/system config
:return: Http profile
def update_application_profile(self, profile_name, pki_profile_ref, tenant_ref, name, avi_config, sysdict):
    '\n        This functions defines to update application profile with pki profile if\n        application profile exist if not create new http profile with pki profile\n        :param profile_name: name of Http profile\n        :param pki_profile_ref:  ref of PKI profile\n        :param tenant_ref: tenant ref\n        :param name: name of virtual service\n        :param avi_config: Dict of AVi config\n        :param sysdict: baseline/system config\n        :return: Http profile\n        '
    try:
        if profile_name:
            app_profile = [p for p in (sysdict['ApplicationProfile'] + avi_config['ApplicationProfile']) if (p['name'] == profile_name)]
            if app_profile:
                app_profile[0]['http_profile']['pki_profile_ref'] = pki_profile_ref
                LOG.debug(('Added PKI profile to application profile successfully : %s' % (profile_name, pki_profile_ref)))
        else:
            app_profile = dict()
            app_profile['name'] = (name + ('-%s-%s' % (random.randrange(0, 1000), ns_constants.PLACE_HOLDER_STR)))
            app_profile['tenant_ref'] = tenant_ref
            app_profile['type'] = 'APPLICATION_PROFILE_TYPE_HTTP'
            http_profile = dict()
            http_profile['connection_multiplexing_enabled'] = False
            http_profile['xff_enabled'] = False
            http_profile['websockets_enabled'] = False
            http_profile['pki_profile_ref'] = pki_profile_ref
            app_profile['http_profile'] = http_profile
            avi_config['ApplicationProfile'].append(app_profile)
            LOG.debug(('Conversion completed successfully for httpProfile: %s' % app_profile['name']))
            return app_profile['name']
    except:
        update_count('error')
        LOG.error('Error in convertion of httpProfile', exc_info=True)