'A method to parse live resource data to update current resource.
NOTE: cannot update users from live resource data in case of
impossibility to get required user password.'

def parse_live_resource_data(self, resource_properties, resource_data):

    dbs = [d.name for d in self.client().databases.list(self.resource_id)]
    dbs_reality = []
    for resource_db in resource_properties[self.DATABASES]:
        if (resource_db[self.DATABASE_NAME] in dbs):
            dbs_reality.append(resource_db)
            dbs.remove(resource_db[self.DATABASE_NAME])
    dbs_reality.extend([{self.DATABASE_NAME: db} for db in dbs])
    result = {self.NAME: resource_data.get('name'), self.DATABASES: dbs_reality}
    if (resource_data.get('flavor') is not None):
        result[self.FLAVOR] = resource_data['flavor'].get('id')
    if (resource_data.get('volume') is not None):
        result[self.SIZE] = resource_data['volume']['size']
    return result
