Example #1
0
    def install(self, force=False):
        if not force and self.is_installed():
            return

        jujuresources.install(self.resources['zookeeper'],
                              destination=self.dist_config.path('zookeeper'),
                              skip_top_level=True)

        self.dist_config.add_users()
        utils.disable_firewall()
        self.dist_config.add_dirs()
        self.dist_config.add_packages()
        self.setup_zookeeper_config()
        self.configure_zookeeper()
        unitdata.kv().set('zookeeper.installed', True)
Example #2
0
    def install(self, force=False):
        if not force and self.is_installed():
            return

        jujuresources.install(self.resources['zookeeper'],
                              destination=self.dist_config.path('zookeeper'),
                              skip_top_level=True)

        self.dist_config.add_users()
        utils.disable_firewall()
        self.dist_config.add_dirs()
        self.dist_config.add_packages()
        self.setup_zookeeper_config()
        self.configure_zookeeper()
        unitdata.kv().set('zookeeper.installed', True)
Example #3
0
 def test_disable_firewall_on_error(self):
     with mock.patch.object(utils, 'check_call') as check_call:
         try:
             with utils.disable_firewall():
                 check_call.assert_called_once_with(['ufw', 'disable'])
                 raise TestError()
         except TestError:
             check_call.assert_called_with(['ufw', 'enable'])
Example #4
0
 def test_disable_firewall_on_error(self):
     with mock.patch.object(utils, 'check_call') as check_call:
         try:
             with utils.disable_firewall():
                 check_call.assert_called_once_with(['ufw', 'disable'])
                 raise TestError()
         except TestError:
             check_call.assert_called_with(['ufw', 'enable'])
Example #5
0
 def install_base_packages(self):
     with utils.disable_firewall():
         self.install_java()
         self.install_hadoop()
Example #6
0
 def install_base_packages(self):
     with utils.disable_firewall():
         self.install_java()
         self.install_hadoop()
Example #7
0
 def test_disable_firewall(self):
     with mock.patch.object(utils, 'check_call') as check_call:
         with utils.disable_firewall():
             check_call.assert_called_once_with(['ufw', 'disable'])
         check_call.assert_called_with(['ufw', 'enable'])
Example #8
0
 def test_disable_firewall(self):
     with mock.patch.object(utils, 'check_call') as check_call:
         with utils.disable_firewall():
             check_call.assert_called_once_with(['ufw', 'disable'])
         check_call.assert_called_with(['ufw', 'enable'])