Projet

Général

Profil

0001-check_hobos-add-redeploy-option-8894.patch

Benjamin Dauvergne, 04 janvier 2016 10:11

Télécharger (1,64 ko)

Voir les différences:

Subject: [PATCH 1/2] check_hobos: add --redeploy option (#8894)

 wcs/ctl/check_hobos.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
wcs/ctl/check_hobos.py
42 42
        Command.__init__(self, [
43 43
                make_option('--ignore-timestamp', action='store_true',
44 44
                            dest='ignore_timestamp', default=False),
45
                make_option('--redeploy', action='store_true', default=False),
45 46
                ])
46 47

  
47 48
    def execute(self, base_options, sub_options, args):
49
        if sub_options.redeploy:
50
            sub_options.ignore_timestamp = True
51
            for tenant in os.listdir(WcsPublisher.APP_DIR):
52
                if tenant.endswith('.invalid'):
53
                    continue
54
                hobo_json_path = os.path.join(tenant, 'hobo.json')
55
                if not os.path.exists(hobo_json_path):
56
                    continue
57
                hobo_json = json.load(open(hobo_json_path))
58
                me = [service for service in hobo_json['services'] if service['this'] is True][0]
59
                self.deploy(base_options, sub_options, [me['base_url'], hobo_json_path])
60
        else:
61
            self.deploy(base_options, sub_options, args)
62

  
63
    def deploy(self, base_options, sub_options, args):
48 64
        import publisher
49 65

  
50 66
        self.base_options = base_options
51
-