def update(self, **kwargs):
        # Check to see if the file name or URI is being passed in. If so,
        # read it's contents first.
        if 'file' in kwargs:
            file = kwargs['file']
            kwargs = utils.load_content(utils.get_contents_if_file(file))

        name = kwargs.get('name', None)
        self._ensure_not_empty(name=name)

        # Convert dict to text for the variables attribute.
        if kwargs.get('variables') and isinstance(kwargs['variables'], dict):
            kwargs['variables'] = json.dumps(kwargs['variables'])

        return self._update('/environments', kwargs)
dataset/ETHPy150Open openstack/python-mistralclient/mistralclient/api/v2/environments.py/EnvironmentManager.update/original