예제 #1
0
 def __init__(self, profile_id, overrides, skip_files, skip_packages, skip_database):
     AttrDict.__init__(self)
     self.profile_id = profile_id
     self.overrides = overrides
     self.skip_files = skip_files
     self.skip_packages = skip_packages
     self.skip_database = skip_database
예제 #2
0
파일: hub.py 프로젝트: BillTheBest/tklbam
    def __init__(self, response):
        self.accesskey = response['accesskey']
        self.secretkey = response['secretkey']
        self.usertoken = response['usertoken']
        self.producttoken = response['producttoken']

        AttrDict.__init__(self)
예제 #3
0
 def __init__(self, profile_id, overrides, skip_files, skip_packages,
              skip_database):
     AttrDict.__init__(self)
     self.profile_id = profile_id
     self.overrides = overrides
     self.skip_files = skip_files
     self.skip_packages = skip_packages
     self.skip_database = skip_database
예제 #4
0
    def __init__(self, path=None):
        AttrDict.__init__(self)
        if path is None:
            path = self.DEFAULT_PATH

        self.path = path
        self.paths = self.Paths(path)

        self.secretfile = None
        self.address = None
        self.force_profile = None
        self.overrides = Limits.fromfile(self.paths.overrides)

        self.volsize = duplicity.Uploader.VOLSIZE
        self.s3_parallel_uploads = duplicity.Uploader.S3_PARALLEL_UPLOADS
        self.full_backup = duplicity.Uploader.FULL_IF_OLDER_THAN

        self.restore_cache_size = duplicity.Downloader.CACHE_SIZE
        self.restore_cache_dir = duplicity.Downloader.CACHE_DIR

        self.backup_skip_files = False
        self.backup_skip_database = False
        self.backup_skip_packages = False

        if not exists(self.paths.conf):
            return

        for line in file(self.paths.conf).read().split("\n"):
            line = line.strip()
            if not line or line.startswith("#"):
                continue

            try:
                opt, val = re.split(r'\s+', line, 1)
            except ValueError:
                raise self._error("illegal line '%s'" % (line))

            try:
                if opt in ('full-backup', 'volsize', 's3-parallel-uploads',
                           'restore-cache-size', 'restore-cache-dir',
                           'backup-skip-files', 'backup-skip-packages',
                           'backup-skip-database', 'force-profile'):

                    attrname = opt.replace('-', '_')
                    setattr(self, attrname, val)

                else:
                    raise self.Error("unknown conf option '%s'" % opt)

            except self.Error, e:
                raise self._error(e)
예제 #5
0
    def __init__(self, path=None):
        AttrDict.__init__(self)
        if path is None:
            path = self.DEFAULT_PATH

        self.path = path
        self.paths = self.Paths(path)

        self.secretfile = None
        self.address = None
        self.force_profile = None
        self.overrides = Limits.fromfile(self.paths.overrides)

        self.volsize = duplicity.Uploader.VOLSIZE
        self.s3_parallel_uploads = duplicity.Uploader.S3_PARALLEL_UPLOADS
        self.full_backup = duplicity.Uploader.FULL_IF_OLDER_THAN

        self.restore_cache_size = duplicity.Downloader.CACHE_SIZE
        self.restore_cache_dir = duplicity.Downloader.CACHE_DIR

        self.backup_skip_files = False
        self.backup_skip_database = False
        self.backup_skip_packages = False

        if not exists(self.paths.conf):
            return

        for line in file(self.paths.conf).read().split("\n"):
            line = line.strip()
            if not line or line.startswith("#"):
                continue

            try:
                opt, val = re.split(r'\s+', line, 1)
            except ValueError:
                raise self._error("illegal line '%s'" % (line))

            try:
                if opt in ('full-backup', 'volsize', 's3-parallel-uploads',
                           'restore-cache-size', 'restore-cache-dir',
                           'backup-skip-files', 'backup-skip-packages', 'backup-skip-database', 'force-profile'):

                    attrname = opt.replace('-', '_')
                    setattr(self, attrname, val)

                else:
                    raise self.Error("unknown conf option '%s'" % opt)

            except self.Error, e:
                raise self._error(e)
예제 #6
0
파일: hub.py 프로젝트: vinodpanicker/tklbam
    def __init__(self, response):
        self.key = response['key']
        self.address = response['address']
        self.backup_id = response['backup_id']
        self.server_id = response['server_id']
        self.profile_id = response['turnkey_version']

        self.created = self._parse_datetime(response['date_created'])
        self.updated = self._parse_datetime(response['date_updated'])

        self.size = int(response['size']) # in MBs
        self.label = response['description']

        # no interface for this in tklbam, so not returned from hub
        self.sessions = []

        AttrDict.__init__(self)
예제 #7
0
    def __init__(self, response):
        self.key = response['key']
        self.address = response['address']
        self.backup_id = response['backup_id']
        self.server_id = response['server_id']
        self.profile_id = response['turnkey_version']

        self.created = self._parse_datetime(response['date_created'])
        self.updated = self._parse_datetime(response['date_updated'])

        self.size = int(response['size'])  # in MBs
        self.label = response['description']

        # no interface for this in tklbam, so not returned from hub
        self.sessions = []

        AttrDict.__init__(self)
예제 #8
0
    def __init__(self, 
                 verbose=True,
                 volsize=VOLSIZE, 
                 full_if_older_than=FULL_IF_OLDER_THAN,
                 s3_parallel_uploads=S3_PARALLEL_UPLOADS, 

                 includes=[], 
                 include_filelist=None,
                 excludes=[],
                 ):

        AttrDict.__init__(self)

        self.verbose = verbose
        self.volsize = volsize
        self.full_if_older_than = full_if_older_than
        self.s3_parallel_uploads = s3_parallel_uploads

        self.includes = includes
        self.include_filelist = include_filelist
        self.excludes = excludes
예제 #9
0
    def __init__(
        self,
        verbose=True,
        volsize=VOLSIZE,
        full_if_older_than=FULL_IF_OLDER_THAN,
        s3_parallel_uploads=S3_PARALLEL_UPLOADS,
        includes=[],
        include_filelist=None,
        excludes=[],
    ):

        AttrDict.__init__(self)

        self.verbose = verbose
        self.volsize = volsize
        self.full_if_older_than = full_if_older_than
        self.s3_parallel_uploads = s3_parallel_uploads

        self.includes = includes
        self.include_filelist = include_filelist
        self.excludes = excludes
예제 #10
0
    def __init__(self, time=None, cache_size=CACHE_SIZE, cache_dir=CACHE_DIR):
        AttrDict.__init__(self)

        self.time = time
        self.cache_size = cache_size
        self.cache_dir = cache_dir
예제 #11
0
 def __init__(self, address, credentials, secret):
     AttrDict.__init__(self)
     self.address = address
     self.credentials = credentials
     self.secret = secret
예제 #12
0
 def __init__(self, d={}):
     AttrDict.__init__(self, d)
     self.overrides = conf.Limits(self.overrides)
예제 #13
0
 def __init__(self, codename, release=None, arch=None):
     AttrDict.__init__(self)
     self.codename = codename
     self.release = release
     self.arch = arch
예제 #14
0
    def __init__(self, time=None, cache_size=CACHE_SIZE, cache_dir=CACHE_DIR):
        AttrDict.__init__(self)

        self.time = time
        self.cache_size = cache_size
        self.cache_dir = cache_dir
예제 #15
0
 def __init__(self, address, credentials, secret):
     AttrDict.__init__(self)
     self.address = address
     self.credentials = credentials
     self.secret = secret
예제 #16
0
 def __init__(self, d={}):
     AttrDict.__init__(self, d)
     self.overrides = conf.Limits(self.overrides)