MCPcopy Create free account
hub / github.com/StackStorm/st2 / get_user

Method get_user

st2common/st2common/models/system/keyvalue.py:80–92  ·  view source on GitHub ↗

Given a user key ``reference``, this method returns the user to whom the key belongs. :param ref: Reference to user key. :type ref: ``str`` :rtype: ``str``

(ref)

Source from the content-addressed store, hash-verified

78
79 @staticmethod
80 def get_user(ref):
81 """
82 Given a user key ``reference``, this method returns the user to whom the key belongs.
83
84 :param ref: Reference to user key.
85 :type ref: ``str``
86
87 :rtype: ``str``
88 """
89 try:
90 return ref.split(USER_SEPARATOR, 1)[0]
91 except (IndexError, AttributeError):
92 raise InvalidUserKeyReferenceError(ref=ref)
93
94 @staticmethod
95 def get_name(ref):

Callers 1

from_string_referenceMethod · 0.45

Calls 1

Tested by

no test coverage detected