コード例 #1
0
ファイル: host.py プロジェクト: Korrigan/pepperstack
 def __call__(self, name, key, *args, **kwargs):
     h = Host.find(name)
     if not h:
         raise DoesNotExistsException("Host {0} does not exists in database"
                                      .format(name))
     h.add(key, *args, **kwargs)
     if self.cli_mode:
         print("Host {0} updated at {1}".format(name, key))
コード例 #2
0
ファイル: host.py プロジェクト: Korrigan/pepperstack
 def __call__(self, name, key):
     h = Host.find(name)
     if not h:
         raise DoesNotExistsException("Host {0} does not exists in database"
                                      .format(name))
     h.remove(key)
     if self.cli_mode:
         print("Host {0} updated (removed {1})".format(name, key))
コード例 #3
0
ファイル: host.py プロジェクト: Korrigan/pepperstack
 def __call__(self, name):
     h = Host.find(name)
     if not h:
         raise DoesNotExistsException("Host {0} does not exists in database"
                                      .format(name))
     h.delete()
     if self.cli_mode:
         print("Host {0} deleted".format(name))
コード例 #4
0
ファイル: host.py プロジェクト: ponkt/pepperstack
 def __call__(self, name, key, *args, **kwargs):
     h = Host.find(name)
     if not h:
         raise DoesNotExistsException(
             "Host {0} does not exists in database".format(name))
     h.add(key, *args, **kwargs)
     if self.cli_mode:
         print("Host {0} updated at {1}".format(name, key))
コード例 #5
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))
     h.delete()
     if self.cli_mode:
         print("Host {0} deleted".format(name))
コード例 #6
0
ファイル: host.py プロジェクト: ponkt/pepperstack
 def __call__(self, name, key):
     h = Host.find(name)
     if not h:
         raise DoesNotExistsException(
             "Host {0} does not exists in database".format(name))
     h.remove(key)
     if self.cli_mode:
         print("Host {0} updated (removed {1})".format(name, key))
コード例 #7
0
ファイル: host.py プロジェクト: Korrigan/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
コード例 #8
0
ファイル: host.py プロジェクト: Korrigan/pepperstack
 def __call__(self, name, key, default=None):
     h = Host.find(name)
     if not h:
         raise DoesNotExistsException("Host {0} does not exists in database"
                                      .format(name))
     ret = h.get(key, default)
     if self.cli_mode:
         print(title(h.name + ':'))
         print("{0}: {1}".format(key, ret))
     return ret
コード例 #9
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
コード例 #10
0
ファイル: host.py プロジェクト: ponkt/pepperstack
 def __call__(self, name, key, default=None):
     h = Host.find(name)
     if not h:
         raise DoesNotExistsException(
             "Host {0} does not exists in database".format(name))
     ret = h.get(key, default)
     if self.cli_mode:
         print(title(h.name + ':'))
         print("{0}: {1}".format(key, ret))
     return ret