Пример #1
0
 def diff_file_revisions(self, path, config_channel_src, revision_src,
                         config_channel_dst, revision_dst):
     log_debug(4)
     params = {
         'session': self.session,
         'path': path,
         'config_channel_src': config_channel_src,
         'revision_src': revision_src,
     }
     if config_channel_dst is not None:
         params['config_channel_dst'] = config_channel_dst
     if revision_dst is not None:
         params['revision_dst'] = revision_dst
     try:
         ret = self.rpc_call('config.management.diff', params)
     except xmlrpclib.Fault:
         e = sys.exc_info()[1]
         if e.faultCode == -4011:
             # File not present
             raise_with_tb(
                 cfg_exceptions.RepositoryFileMissingError(e.faultString),
                 sys.exc_info()[2])
         if e.faultCode == -4004:
             # Binary file requested
             raise_with_tb(
                 cfg_exceptions.BinaryFileDiffError(e.faultString),
                 sys.exc_info()[2])
         raise
     return ret
Пример #2
0
 def get_raw_file_info(self, config_channel, repopath, revision=None):
     """ given a namepath, return the raw data  passed by the server """
     log_debug(5)
     params = {
         'session': self.session,
         'config_channel': config_channel,
         'path': repopath,
     }
     if revision is not None:
         params['revision'] = revision
     try:
         result = self.rpc_call('config.management.get_file', params)
     except xmlrpclib.Fault, e:
         if e.faultCode == -4011:
             # File not present
             raise cfg_exceptions.RepositoryFileMissingError(
                 config_channel, repopath), None, sys.exc_info()[2]
         raise
Пример #3
0
 def get_file_revisions(self, config_channel, repopath):
     """
     Fetch the file's revisions
     """
     log_debug(4)
     params = {
         'session': self.session,
         'config_channel': config_channel,
         'path': repopath,
     }
     try:
         revisions = self.rpc_call('config.management.list_file_revisions',
                                   params)
     except xmlrpclib.Fault, e:
         if e.faultCode == -4011:
             # File not present
             raise cfg_exceptions.RepositoryFileMissingError(
                 config_channel, repopath), None, sys.exc_info()[2]
         raise