Projet

Général

Profil

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

Benjamin Dauvergne, 18 décembre 2015 23:17

Télécharger (1,56 ko)

Voir les différences:

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

 wcs/ctl/check_hobos.py | 14 ++++++++++++++
 1 file changed, 14 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
                hobo_json_path = os.path.join(tenant, 'hobo.json')
53
                if not os.path.exists(hobo_json_path):
54
                    continue
55
                hobo_json = json.load(open(hobo_json_path))
56
                me = [service for service in hobo_json['services'] if service['this'] is True][0]
57
                self.deploy(base_options, sub_options, [me['base_url'], hobo_json_path])
58
        else:
59
            self.deploy(base_options, sub_options, args)
60

  
61
    def deploy(self, base_options, sub_options, args):
48 62
        import publisher
49 63

  
50 64
        self.base_options = base_options
51
-