'Idempotent function to ensure the host group
does not exist in your LogicMonitor account'

def remove(self):

    self.module.debug('Running    Hostgroup.remove...')
    if self.info:
        self.module.debug('Group    exists')
        self.module.debug('System    changed')
        self.change = True
        if self.check_mode:
            self.exit(changed=True)
        self.module.debug("Making    RPC    call    to    'deleteHostGroup'")
        resp = json.loads(self.rpc('deleteHostGroup', {'hgId': self.info['id']}))
        if (resp['status'] == 200):
            self.module.debug(resp)
            self.module.debug('RPC    call    succeeded')
            return resp
        elif (resp['errmsg'] == 'No    such    group'):
            self.module.debug("Group    doesn't    exist")
        else:
            self.module.debug('RPC    call    failed')
            self.module.debug(resp)
            self.fail(msg=resp['errmsg'])
    else:
        self.module.debug("Group    doesn't    exist")
