Merge remote-tracking branch 'origin/master' into renew-symlink-safety

This commit is contained in:
Peter Eckersley 2016-09-29 13:55:55 -07:00
commit dd46661547
5 changed files with 36 additions and 30 deletions

1
.gitignore vendored
View file

@ -24,6 +24,7 @@ tags
*.sw?
\#*#
.idea
.ropeproject
# auth --cert-path --chain-path
/*.pem

View file

@ -1,11 +1,8 @@
ChangeLog
=========
Please note:
the change log will only get updated after first release - for now please use the
`commit log <https://github.com/certbot/certbot/commits/master>`_.
To see the changes in a given release, view the issues closed in a given
release's GitHub milestone:
To see the changes in a given release, inspect the github milestone for the
release. For instance:
https://github.com/certbot/certbot/issues?utf8=%E2%9C%93&q=milestone%3A0.3.0
- `Past releases <https://github.com/certbot/certbot/milestones?state=closed>`_
- `Upcoming releases <https://github.com/certbot/certbot/milestones>`_

View file

@ -15,4 +15,21 @@ to the Sphinx generated docs is provided below.
-->
https://certbot.eff.org/docs/contributing.html
# Certbot Contributing Guide
Hi! Welcome to the Certbot project. We look forward to collaborating with you.
If you're reporting a bug in Certbot, please make sure to include:
- The version of Certbot you're running.
- The operating system you're running it on.
- The commands you ran.
- What you expected to happen, and
- What actually happened.
If you're a developer, we have some helpful information in our
[Developer's Guide](https://certbot.eff.org/docs/contributing.html) to get you
started. In particular, we recommend you read these sections
- [Finding issues to work on](https://certbot.eff.org/docs/contributing.html#find-issues-to-work-on)
- [Coding style](https://certbot.eff.org/docs/contributing.html#coding-style)
- [Submitting a pull request](https://certbot.eff.org/docs/contributing.html#submitting-a-pull-request)

View file

@ -103,18 +103,8 @@ def choose_names(installer):
names = get_valid_domains(domains)
if not names:
manual = z_util(interfaces.IDisplay).yesno(
"No names were found in your configuration files.{0}You should "
"specify ServerNames in your config files in order to allow for "
"accurate installation of your certificate.{0}"
"If you do use the default vhost, you may specify the name "
"manually. Would you like to continue?{0}".format(os.linesep),
default=True)
if manual:
return _choose_names_manually()
else:
return []
return _choose_names_manually(
"No names were found in your configuration files. ")
code, names = _filter_names(names)
if code == display_util.OK and names:
@ -157,10 +147,17 @@ def _filter_names(names):
return code, [str(s) for s in names]
def _choose_names_manually():
"""Manually input names for those without an installer."""
def _choose_names_manually(prompt_prefix=""):
"""Manually input names for those without an installer.
:param str prompt_prefix: string to prepend to prompt for domains
:returns: list of provided names
:rtype: `list` of `str`
"""
code, input_ = z_util(interfaces.IDisplay).input(
prompt_prefix +
"Please enter in your domain name(s) (comma and/or space separated) ",
cli_flag="--domains")

View file

@ -206,20 +206,14 @@ class ChooseNamesTest(unittest.TestCase):
@mock.patch("certbot.display.ops.z_util")
def test_no_names_choose(self, mock_util):
self.mock_install().get_all_names.return_value = set()
mock_util().yesno.return_value = True
domain = "example.com"
mock_util().input.return_value = (display_util.OK, domain)
actual_doms = self._call(self.mock_install)
self.assertEqual(mock_util().input.call_count, 1)
self.assertEqual(actual_doms, [domain])
@mock.patch("certbot.display.ops.z_util")
def test_no_names_quit(self, mock_util):
self.mock_install().get_all_names.return_value = set()
mock_util().yesno.return_value = False
self.assertEqual(self._call(self.mock_install), [])
self.assertTrue(
"configuration files" in mock_util().input.call_args[0][0])
@mock.patch("certbot.display.ops.z_util")
def test_filter_names_valid_return(self, mock_util):