'This method takes changes made to this host
and applies them to the corresponding host
in your LogicMonitor account.'

def update(self):

    self.module.debug('Running    Host.update...')
    if self.info:
        self.module.debug('Host    already    registed')
        if self.is_changed():
            self.module.debug('System    changed')
            self.change = True
            if self.check_mode:
                self.exit(changed=True)
            h = self._build_host_hash(self.hostname, self.displayname, self.collector, self.description, self.groups, self.properties, self.alertenable)
            h['id'] = self.info['id']
            h['opType'] = 'replace'
            self.module.debug("Making    RPC    call    to    'updateHost'")
            resp = json.loads(self.rpc('updateHost', h))
            if (resp['status'] == 200):
                self.module.debug('RPC    call    succeeded')
            else:
                self.module.debug('RPC    call    failed')
                self.fail(msg='Error:    unable    to    update    the    host.')
        else:
            self.module.debug(('Host    properties    match    supplied    properties.    ' + 'No    changes    to    make.'))
            return self.info
    else:
        self.module.debug('Host    not    registed.    Registering')
        self.module.debug('System    changed')
        self.change = True
        if self.check_mode:
            self.exit(changed=True)
        return self.add()
