示例#1
0
 def __call__(self, name):
     r = Role.find(name)
     if not r:
         raise DoesNotExistsException(
             "Role {0} does not exists in database".format(name))
     ret = r.as_dict()
     if self.cli_mode:
         print(title(r.name + ':'))
         pretty_print(ret)
     return ret
示例#2
0
 def __call__(self, name):
     r = Role.find(name)
     if not r:
         raise DoesNotExistsException("Role {0} does not exists in database"
                                      .format(name))
     ret = r.as_dict()
     if self.cli_mode:
         print(title(r.name + ':'))
         pretty_print(ret)
     return ret
示例#3
0
 def __call__(self, name):
     h = Host.find(name)
     if not h:
         raise DoesNotExistsException("Host {0} does not exists in database"
                                      .format(name))
     ret = h.as_dict()
     if self.cli_mode:
         print(title(h.name + ':'))
         pretty_print(ret)
     return ret
示例#4
0
文件: host.py 项目: ponkt/pepperstack
 def __call__(self, name):
     h = Host.find(name)
     if not h:
         raise DoesNotExistsException(
             "Host {0} does not exists in database".format(name))
     ret = h.as_dict()
     if self.cli_mode:
         print(title(h.name + ':'))
         pretty_print(ret)
     return ret