def accept(self):
        name = self.name_line_edit.text().strip()
        password = self.password_line_edit.text()
        if self.just_save:
            confirm_password = password
        else:
            confirm_password = self.confirm_password_line_edit.text()
        cred_file = self.cred_file_line_edit.text()
        project = self.project_line_edit.text().strip()
        bucket = self.bucket_line_edit.text().strip()
        prefix = self.prefix_line_edit.text().strip()

        backup = Backup()
        backup.name = name
        backup.location = "Google Cloud"
        backup.password = password
        backup.gcp_cred_file = cred_file
        backup.gcp_project = project
        backup.gcp_bucket = bucket
        backup.cloud_prefix = prefix
        self.backup = backup

        fs = [Validator.validate_plan_name, Validator.validate_confirm_password,
            Validator.validate_local_path, Validator.validate_non_empty,
            Validator.validate_non_empty, Validator.validate_non_empty,
            Validator.validate_no_space, Validator.validate_no_space,
            Validator.validate_backend, Validator.validate_repo]
        args = [(name, ), (password, confirm_password), (cred_file, ),
            ("Project", project), ("Bucket", bucket), ("Prefix", prefix),
            ("Bucket", bucket), ("Prefix", prefix), (backup, ),
            (backup, self.just_save)]
        self.setEnabled(False)
        self.thread = CommandThread(config_worker, {"fs": fs, "args": args})
        self.thread.result.connect(self.command_done)
        self.thread.start()
    def accept(self):
        name = self.name_line_edit.text().strip()
        password = self.password_line_edit.text()
        if self.just_save:
            confirm_password = password
        else:
            confirm_password = self.confirm_password_line_edit.text()
        connection = self.connection_line_edit.text().strip()
        container = self.container_line_edit.text().strip()
        prefix = self.prefix_line_edit.text().strip()

        backup = Backup()
        backup.name = name
        backup.location = "Microsoft Azure"
        backup.password = password
        backup.azure_conn_str = connection
        backup.azure_container = container
        backup.cloud_prefix = prefix
        self.backup = backup

        fs = [Validator.validate_plan_name, Validator.validate_confirm_password,
            Validator.validate_non_empty, Validator.validate_non_empty,
            Validator.validate_non_empty, Validator.validate_no_space,
            Validator.validate_no_space, Validator.validate_backend,
            Validator.validate_repo]
        args = [(name, ), (password, confirm_password),
            ("Connection String", connection), ("Container", container),
            ("Prefix", prefix), ("Container", container), ("Prefix", prefix),
            (backup, ), (backup, self.just_save)]   
        self.setEnabled(False)
        self.thread = CommandThread(config_worker, {"fs": fs, "args": args})
        self.thread.result.connect(self.command_done)
        self.thread.start()
示例#3
0
 def test_get_backend__b2(self):
     backup = Backup()
     backup.location = "Backblaze B2"
     backup.b2_key_id = environ["BLOBBACKUP_B2_KEY_ID"]
     backup.b2_key = environ["BLOBBACKUP_B2_KEY"]
     backup.b2_bucket = environ["BLOBBACKUP_B2_BUCKET"]
     backup.cloud_prefix = "tmp"
     self._verify_backend(Utils.get_backend(backup), B2Backend)
示例#4
0
 def test_get_backend__gcp(self):
     backup = Backup()
     backup.location = "Google Cloud"
     backup.gcp_cred_file = environ["BLOBBACKUP_GCP_CRED_FILE"]
     backup.gcp_project = environ["BLOBBACKUP_GCP_PROJECT"]
     backup.gcp_bucket = environ["BLOBBACKUP_GCP_BUCKET"]
     backup.cloud_prefix = "tmp"
     self._verify_backend(Utils.get_backend(backup), GcpBackend)
示例#5
0
 def test_get_backend__aws(self):
     backup = Backup()
     backup.location = "Amazon AWS"
     backup.aws_key_id = environ["BLOBBACKUP_AWS_KEY_ID"]
     backup.aws_key = environ["BLOBBACKUP_AWS_KEY"]
     backup.aws_bucket = environ["BLOBBACKUP_AWS_BUCKET"]
     backup.cloud_prefix = "tmp"
     self._verify_backend(Utils.get_backend(backup), AwsBackend)
    def accept(self):
        name = self.name_line_edit.text().strip()
        password = self.password_line_edit.text()
        if self.just_save:
            confirm_password = password
        else:
            confirm_password = self.confirm_password_line_edit.text()
        private_key = self.private_key_line_edit.text()
        username = self.username_line_edit.text().strip()
        sftp_password = self.sftp_password_line_edit.text().strip()
        server = self.server_line_edit.text().strip()
        prefix = self.prefix_line_edit.text().strip()

        backup = Backup()
        backup.name = name
        backup.location = "SFTP"
        backup.password = password
        if len(private_key) is not 0:
            backup.sftp_private_key = private_key
        backup.sftp_username = username
        if len(sftp_password) is not 0:
            backup.sftp_password = sftp_password
        backup.sftp_server = server
        backup.cloud_prefix = prefix
        self.backup = backup

        fs = [
            Validator.validate_plan_name, Validator.validate_confirm_password,
            Validator.validate_non_empty, Validator.validate_non_empty,
            Validator.validate_non_empty, Validator.validate_no_space,
            Validator.validate_no_space, Validator.validate_no_space,
            Validator.validate_backend, Validator.validate_repo
        ]
        args = [(name, ), (password, confirm_password), ("Username", username),
                ("Server", server), ("Prefix", prefix), ("Server", server),
                ("Prefix", prefix), ("Username", username), (backup, ),
                (backup, self.just_save)]
        self.setEnabled(False)
        self.thread = CommandThread(config_worker, {"fs": fs, "args": args})
        self.thread.result.connect(self.command_done)
        self.thread.start()
示例#7
0
    def accept(self):
        name = self.name_line_edit.text().strip()
        password = self.password_line_edit.text()
        if self.just_save:
            confirm_password = password
        else:
            confirm_password = self.confirm_password_line_edit.text()
        directory = self.local_directory_line_edit.text()

        backup = Backup()
        backup.name = name
        backup.location = "Local Directory"
        backup.password = password
        backup.local_directory = directory
        self.backup = backup

        fs = [
            Validator.validate_plan_name, Validator.validate_confirm_password,
            Validator.validate_local_path, Validator.validate_backend,
            Validator.validate_repo
        ]
        args = [(name, ), (password, confirm_password), (directory, ),
                (backup, ), (backup, self.just_save)]
        self.setEnabled(False)
        self.thread = CommandThread(config_worker, {"fs": fs, "args": args})
        self.thread.result.connect(self.command_done)
        self.thread.start()
示例#8
0
    def accept(self):
        name = self.name_line_edit.text().strip()
        password = self.password_line_edit.text()
        if self.just_save:
            confirm_password = password
        else:
            confirm_password = self.confirm_password_line_edit.text()
        url = self.s3_url_line_edit.text().strip()
        key_id = self.key_id_line_edit.text().strip()
        key = self.key_line_edit.text().strip()
        bucket = self.bucket_line_edit.text().strip()
        prefix = self.prefix_line_edit.text().strip()

        backup = Backup()
        backup.name = name
        backup.location = "S3 Storage"
        backup.password = password
        backup.s3_url = url
        backup.aws_key_id = key_id
        backup.aws_key = key
        backup.aws_bucket = bucket
        backup.cloud_prefix = prefix
        self.backup = backup

        fs = [
            Validator.validate_plan_name, Validator.validate_confirm_password,
            Validator.validate_non_empty, Validator.validate_non_empty,
            Validator.validate_non_empty, Validator.validate_non_empty,
            Validator.validate_non_empty, Validator.validate_no_space,
            Validator.validate_no_space, Validator.validate_backend,
            Validator.validate_repo
        ]
        args = [(name, ), (password, confirm_password), ("AWS Key Id", key_id),
                ("S3 URL", url), ("AWS Key", key), ("Bucket", bucket),
                ("Prefix", prefix), ("Bucket", bucket), ("Prefix", prefix),
                (backup, ), (backup, self.just_save)]
        self.setEnabled(False)
        self.thread = CommandThread(config_worker, {"fs": fs, "args": args})
        self.thread.result.connect(self.command_done)
        self.thread.start()
示例#9
0
 def test_get_backend__azure(self):
     backup = Backup()
     backup.location = "Microsoft Azure"
     backup.azure_conn_str = environ["BLOBBACKUP_AZURE_CONN_STR"]
     backup.azure_container = environ["BLOBBACKUP_AZURE_CONTAINER"]
     backup.cloud_prefix = "tmp"
     self._verify_backend(Utils.get_backend(backup), AzureBackend)
示例#10
0
 def test_get_backend__local(self):
     backup = Backup()
     backup.location = "Local Directory"
     backup.local_directory = "."
     self._verify_backend(Utils.get_backend(backup), LocalBackend)
示例#11
0
 def test_get_backend__memory(self):
     backup = Backup()
     backup.location = "Memory"
     self._verify_backend(Utils.get_backend(backup), MemoryBackend)