Пример #1
0
 def install(self, backend):
     utils.install_builtin_server()
     if backend.different("ssl-cert-path", "ssl-cert-contents", "ssl-key-contents"):
         config = backend.config
         utils.save_or_create_certificates(
             config["ssl-cert-path"], config.get("ssl-cert-contents"), config.get("ssl-key-contents")
         )
Пример #2
0
 def install(self, backend):
     utils.install_builtin_server()
     if backend.different(
             'ssl-cert-path', 'ssl-cert-contents', 'ssl-key-contents'):
         config = backend.config
         utils.save_or_create_certificates(
             config['ssl-cert-path'], config.get('ssl-cert-contents'),
             config.get('ssl-key-contents'))
Пример #3
0
 def test_call(self, mock_log, mock_run):
     # The builtin server its correctly installed.
     install_builtin_server()
     charm_dir = os.path.abspath(
         os.path.join(os.path.dirname(__file__), '..'))
     mock_log.assert_has_calls([
         mock.call('Installing the builtin server dependencies.'),
         mock.call('Installing the builtin server.'),
     ])
     mock_run.assert_has_calls([
         mock.call(
             'pip2', 'install', '--no-index', '--no-dependencies',
             '--find-links', 'file:///{}/deps'.format(charm_dir),
             '-r', os.path.join(charm_dir, 'server-requirements.pip')),
         mock.call(
             '/usr/bin/python',
             os.path.join(charm_dir, 'server', 'setup.py'), 'install')
     ])
Пример #4
0
 def test_call(self, mock_log, mock_run):
     # The builtin server its correctly installed.
     install_builtin_server()
     charm_dir = os.path.abspath(
         os.path.join(os.path.dirname(__file__), '..'))
     mock_log.assert_has_calls([
         mock.call('Installing the builtin server dependencies.'),
         mock.call('Installing the builtin server.'),
     ])
     mock_run.assert_has_calls([
         mock.call(
             'pip2', 'install', '--no-index', '--no-dependencies',
             '--find-links', 'file:///{}/deps'.format(charm_dir),
             '-r', os.path.join(charm_dir, 'server-requirements.pip')),
         mock.call(
             '/usr/bin/python',
             os.path.join(charm_dir, 'server', 'setup.py'), 'install')
     ])
Пример #5
0
 def test_call(self, mock_log, mock_run):
     # The builtin server its correctly installed.
     install_builtin_server()
     charm_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
     mock_log.assert_has_calls(
         [mock.call("Installing the builtin server dependencies."), mock.call("Installing the builtin server.")]
     )
     mock_run.assert_has_calls(
         [
             mock.call(
                 "pip2",
                 "install",
                 "--no-index",
                 "--no-dependencies",
                 "--find-links",
                 "file:///{}/deps".format(charm_dir),
                 "-r",
                 os.path.join(charm_dir, "server-requirements.pip"),
             ),
             mock.call("/usr/bin/python", os.path.join(charm_dir, "server", "setup.py"), "install"),
         ]
     )
Пример #6
0
 def test_install_builtin_server(self):
     install_builtin_server()
     # Two run calls are executed: one for the dependencies, one for the
     # server itself.
     self.assertEqual(2, self.run_call_count)
Пример #7
0
 def install(self, backend):
     utils.install_builtin_server()
     self._setup_certificates(backend)
Пример #8
0
 def test_install_builtin_server(self):
     install_builtin_server()
     # Two run calls are executed: one for the dependencies, one for the
     # server itself.
     self.assertEqual(2, self.run_call_count)