Skip to content

StorageStatusMask in locate Request #731

@bernyspeedy

Description

@bernyspeedy

StorageStatusMask is defined in enums.py.
The documentation tells, that this has to be an integer.
However, when I try a locate and set the storage_status_mask to enums.StorageStatusMask.ONLINE_STORAGE.value
the server throws the follwinging error:

======================
2025-08-11 09:58:45,344 - kmip.services.kmip_server - ERROR - KMIPServer <type 'exceptions.TypeError'> read() takes exactly 2 arguments (1 given)
Traceback (most recent call last):
File "/root/cayman_pykmip/pykmip/src/kmip/services/kmip_server.py", line 82, in serve_connection
self._processor.process(protocol, protocol)
File "/root/cayman_pykmip/pykmip/src/kmip/services/processor.py", line 85, in process
message.read(stream)
File "/root/cayman_pykmip/pykmip/src/kmip/core/messages/messages.py", line 353, in read
batch_item.read(istream)
File "/root/cayman_pykmip/pykmip/src/kmip/core/messages/messages.py", line 204, in read
self.request_payload.read(tstream)
File "/root/cayman_pykmip/pykmip/src/kmip/core/messages/payloads/locate.py", line 69, in read
self.storage_status_mask.read()
TypeError: read() takes exactly 2 arguments (1 given)

My request was

from kmip.pie import client
from kmip.pie import objects
from kmip.core import enums
from kmip.core import primitives
from kmip.core.factories import attributes
from kmip.core.primitives import Enumeration

f = attributes.AttributeFactory()
c = client.ProxyKmipClient()

with c:
... c.locate(
... storage_status_mask = enums.StorageStatusMask.ONLINE_STORAGE.value
... ,
... attributes=[
... f.create_attribute(
... enums.AttributeType.OBJECT_TYPE,
... enums.ObjectType.SYMMETRIC_KEY,
... ),
...
... ]
... )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions