Repository: certbot/certbot

Issue:
Broken "install"
```
(venv)root@le:~# ./letsencrypt/letsencrypt-auto install --cert-path /etc/letsencrypt/live/kuba.us.to/cert.pem --key-path /etc//letsencrypt/live/kuba.us.to/key.pem --text --agree-dev-preview
Updating letsencrypt and virtual environment dependencies......
Running with virtualenv: /root/.local/share/letsencrypt/bin/letsencrypt install --cert-path /etc/letsencrypt/live/kuba.us.to/cert.pem --key-path /etc//letsencrypt/live/kuba.us.to/key.pem --text --agree-dev-preview
2015-10-30 16:41:57,941:ERROR:letsencrypt.le_util:Error while running apache2ctl configtest.
Action 'configtest' failed.
The Apache error log may have more information.

apache2: Syntax error on line 219 of /etc/apache2/apache2.conf: Syntax error on line 32 of /etc/apache2/sites-enabled/000-default-le-ssl.conf: Could not open configuration file /etc/letsencrypt/options-ssl-apache.conf: No such file or directory


How would you like to authenticate with the Let's Encrypt CA?
-------------------------------------------------------------------------------
1: Apache Web Server - Alpha (apache) [Misconfigured]
2: Automatically use a temporary webserver (standalone)
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Please enter in your domain name(s) (comma and/or space separated)  (Enter 'c'
to cancel):kuba.us.to
2015-10-30 16:42:10,488:WARNING:letsencrypt.client:No installer specified, client is unable to deploythe certificate
No installer available
(venv)root@le:~# ./letsencrypt/letsencrypt-auto install --version
Updating letsencrypt and virtual environment dependencies......
Running with virtualenv: /root/.local/share/letsencrypt/bin/letsencrypt install --version
letsencrypt 0.0.0.dev20151030
```

@pde, I think it's the last call to start writing test. Every single CLI PR introduces regressions.



Discussion:

Resolving patch:
diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py
--- a/letsencrypt/cli.py
+++ b/letsencrypt/cli.py
@@ -85,6 +85,7 @@
    plugins (certonly, install, nginx, apache, standalone, etc)
 """
 
+
 def usage_strings(plugins):
     """Make usage strings late so that plugins can be initialised late"""
     if "nginx" in plugins:
@@ -494,7 +495,8 @@ def install(args, config, plugins):
     # XXX: Update for renewer/RenewableCert
 
     try:
-        installer, _ = choose_configurator_plugins(args, config, plugins, "certonly")
+        installer, _ = choose_configurator_plugins(args, config,
+                                                   plugins, "install")
     except PluginSelectionError, e:
         return e.message
 


Test patch:
diff --git a/letsencrypt/tests/cli_test.py b/letsencrypt/tests/cli_test.py
--- a/letsencrypt/tests/cli_test.py
+++ b/letsencrypt/tests/cli_test.py
@@ -106,6 +106,12 @@ def test_help(self):
             from letsencrypt import cli
             self.assertTrue(cli.usage_strings(plugins)[0] in out)
 
+    @mock.patch('letsencrypt.cli.display_ops')
+    def test_installer_selection(self, mock_display_ops):
+        self._call(['install', '--domain', 'foo.bar', '--cert-path', 'cert',
+                    '--key-path', 'key', '--chain-path', 'chain'])
+        self.assertEqual(mock_display_ops.pick_installer.call_count, 1)
+
     def test_configurator_selection(self):
         real_plugins = disco.PluginsRegistry.find_all()
         args = ['--agree-dev-preview', '--apache',
@@ -221,7 +227,7 @@ def test_certonly_renewal(self, mock_init, mock_renewal, mock_get_utility):
     @mock.patch('letsencrypt.cli.zope.component.getUtility')
     @mock.patch('letsencrypt.cli._init_le_client')
     def test_certonly_csr(self, mock_init, mock_get_utility,
-                      mock_pick_installer, mock_notAfter):
+                          mock_pick_installer, mock_notAfter):
         cert_path = '/etc/letsencrypt/live/blahcert.pem'
         date = '1970-01-01'
         mock_notAfter().date.return_value = date