def _servicegroup_get(sg_name, **connection_args): ''' Return a service group ressource or None ''' nitro = _connect(**connection_args) if nitro is None: return None sg = NSServiceGroup() sg.set_servicegroupname(sg_name) try: sg = NSServiceGroup.get(nitro, sg) except NSNitroError, e: log.debug('netscaler module error - NSServiceGroup.get() failed: {0}'.format(e.message)) sg = None
def _servicegroup_get(sg_name, **connection_args): """ Return a service group ressource or None """ nitro = _connect(**connection_args) if nitro is None: return None sg = NSServiceGroup() sg.set_servicegroupname(sg_name) try: sg = NSServiceGroup.get(nitro, sg) except NSNitroError as error: log.debug("netscaler module error - NSServiceGroup.get() failed: {0}".format(error)) sg = None _disconnect(nitro) return sg
def _servicegroup_get(sg_name, **connection_args): """ Return a service group ressource or None """ nitro = _connect(**connection_args) if nitro is None: return None sg = NSServiceGroup() sg.set_servicegroupname(sg_name) try: sg = NSServiceGroup.get(nitro, sg) except NSNitroError as error: log.debug("netscaler module error - NSServiceGroup.get() failed: %s", error) sg = None _disconnect(nitro) return sg
def _servicegroup_get(sg_name, **connection_args): ''' Return a service group ressource or None ''' nitro = _connect(**connection_args) if nitro is None: return None sg = NSServiceGroup() sg.set_servicegroupname(sg_name) try: sg = NSServiceGroup.get(nitro, sg) except NSNitroError, e: log.debug( 'netscaler module error - NSServiceGroup.get() failed: {0}'.format( e.message)) sg = None