本文整理汇总了Python中calvin.utilities.security.Security.check_security_actor_requirements方法的典型用法代码示例。如果您正苦于以下问题:Python Security.check_security_actor_requirements方法的具体用法?Python Security.check_security_actor_requirements怎么用?Python Security.check_security_actor_requirements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类calvin.utilities.security.Security
的用法示例。
在下文中一共展示了Security.check_security_actor_requirements方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Actor
# 需要导入模块: from calvin.utilities.security import Security [as 别名]
# 或者: from calvin.utilities.security.Security import check_security_actor_requirements [as 别名]
#.........这里部分代码省略.........
@verify_status([STATUS.LOADED])
def setup_complete(self):
self.fsm.transition_to(Actor.STATUS.READY)
def init(self):
raise Exception("Implementing 'init()' is mandatory.")
def will_start(self):
"""Override in actor subclass if actions need to be taken before starting."""
pass
def will_stop(self):
"""Override in actor subclass if actions need to be taken before stopping."""
pass
def will_migrate(self):
"""Override in actor subclass if actions need to be taken before migrating."""
pass
def did_migrate(self):
"""Override in actor subclass if actions need to be taken after migrating."""
pass
def will_end(self):
"""Override in actor subclass if actions need to be taken before destruction."""
pass
@verify_status([STATUS.LOADED])
def check_requirements(self):
""" Checks that all requirements are available and accessable in calvinsys """
# Check the runtime and calvinsys execution access rights
# Note when no credentials set no verification done
if hasattr(self, 'sec') and not self.sec.check_security_actor_requirements(['runtime'] +
(self.requires if hasattr(self, "requires") else [])):
_log.debug("Security check on actor requirements failed")
raise Exception('actor calvinsys security requirement not fullfilled')
# Check availability of calvinsys subsystems
if hasattr(self, "requires"):
for req in self.requires:
if not self._calvinsys.has_capability(req):
raise Exception("%s requires %s" % (self.id, req))
def __getitem__(self, attr):
if attr in self._using:
return self._using[attr]
raise KeyError(attr)
def use(self, requirement, shorthand):
self._using[shorthand] = self._calvinsys.use_requirement(self, requirement)
def __str__(self):
ip = ""
for p in self.inports.values():
ip = ip + str(p)
op = ""
for p in self.outports.values():
op = op + str(p)
s = "Actor: '%s' class '%s'\nstatus: %s\ninports: %s\noutports:%s" % (
self.name, self._type, self.fsm, ip, op)
return s
@verify_status([STATUS.READY])
def set_port_property(self, port_type, port_name, port_property, value):
"""Change a port property. Currently, setting 'fanout' on output ports is only allowed operation."""