def action(self, entity, action, attributes, extras):
        """
        This is called by pyssf when an action request is issued.
        """
        context = extras['nova_ctx']
        uid = entity.attributes['occi.core.id']

        if action == os_addon.OS_CHG_PWD:
            if 'org.openstack.credentials.admin_pwd' not in attributes:
                msg = 'org.openstack.credentials.admin_pwd was not supplied'\
                      ' in the request.'
                raise AttributeError(msg)

            new_password = attributes['org.openstack.credentials.admin_pwd']
            vm.set_password_for_vm(uid, new_password, context)
        elif action == os_addon.OS_CREATE_IMAGE:
            if attributes not in 'org.openstack.snapshot.image_name':
                raise AttributeError('Missing image name')

            image_name = attributes['org.openstack.snapshot.image_name']
            vm.snapshot_vm(uid, image_name, context)
        else:
            raise AttributeError('Not an applicable action.')
dataset/ETHPy150Open tmetsch/occi-os/occi_os_api/backends/openstack.py/OsComputeBackend.action/swapped operands of `not in`