#NEWLINE# def servicegroup_exists( sg_name , sg_type = None , **connection_args ) : #NEWLINE# #INDENT# "\n    Checks if a service group exists\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' netscaler.servicegroup_exists 'serviceGroupName'\n    " #NEWLINE# sg = _servicegroup_get ( sg_name , ** connection_args ) #NEWLINE# if ( sg is None ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( ( sg_type is not None ) and ( sg_type . upper ( ) != sg . get_servicetype ( ) ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# return True