def servicegroup_exists(sg_name, sg_type=None, **connection_args):
 sg = _servicegroup_get(sg_name, **connection_args)
 if (sg is None):
  return False
 if ((sg_type is not None) and (sg_type.upper() != sg.get_servicetype())):
  return False
 return True

def servicegroup_exists ( sg_name , sg_type = None , ** connection_args ) : sg = _servicegroup_get ( sg_name , ** connection_args ) if ( sg is None ) : return False if ( ( sg_type is not None ) and ( sg_type . upper ( ) != sg . get_servicetype ( ) ) ) : return False return True
checks if a service group exists cli example: .