summaryrefslogtreecommitdiffstats
path: root/src/test/rgw/rgw_multi/zone_az.py
blob: aaab3ef74cf579db104f853f3983b95e2cee23f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import logging

from .multisite import Zone


log = logging.getLogger('rgw_multi.tests')


class AZone(Zone):  # pylint: disable=too-many-ancestors
    """ archive zone class """
    def __init__(self, name, zonegroup=None, cluster=None, data=None, zone_id=None, gateways=None):
        super(AZone, self).__init__(name, zonegroup, cluster, data, zone_id, gateways)

    def is_read_only(self):
        return False

    def tier_type(self):
        return "archive"

    def create(self, cluster, args=None, **kwargs):
        if args is None:
            args = ''
        args += ['--tier-type', self.tier_type()]
        return self.json_command(cluster, 'create', args)

    def has_buckets(self):
        return False


class AZoneConfig:
    """ archive zone configuration """
    def __init__(self, cfg, section):
        pass


def print_connection_info(conn):
    """print info of connection"""
    print("Host: " + conn.host+':'+str(conn.port))
    print("AWS Secret Key: " + conn.aws_secret_access_key)
    print("AWS Access Key: " + conn.aws_access_key_id)