Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not add entries that already exist #85

Closed
wants to merge 1 commit into from

Conversation

jugglinmike
Copy link
Contributor

Modification of the system hostfile requires administrative privileges,
but some users may not want to grant those rights to this plugin. The
plugin already scans the hosts file for previously-existing entries, but
the heuristic is very strict and only matches machine-generated entries
as produced by the plugin itself.

Allow consumers to opt out of automatic hostfile modification (thereby
avoiding the need to grant additional privileges) by relaxing the
requirements for "matching" entries. Update the status messages to
document this behavior.

This resolves gh-69.

Modification of the system hostfile requires administrative privileges,
but some users may not want to grant those rights to this plugin. The
plugin already scans the hosts file for previously-existing entries, but
the heuristic is very strict and only matches machine-generated entries
as produced by the plugin itself.

Allow consumers to opt out of automatic hostfile modification (thereby
avoiding the need to grant additional privileges) by relaxing the
requirements for "matching" entries. Update the status messages to
document this behavior.
@cgsmith
Copy link
Collaborator

cgsmith commented Nov 9, 2015

I like this change :). I had issues before where the checks would add multiple entries do to vagrant destroy not properly hooking in.

Ill test this out and report back. Anyone else reading feel free to test and comment. Thanks @jugglinmike

@QWp6t
Copy link

QWp6t commented Nov 19, 2015

In Windows hosts files (and possibly others, I don't know), you can have multiple host names on one line.

192.168.56.101    www.example.com example.com

This would fail if it looked for hostEntryPattern("192.168.56.101", "example.com") because the preceding www.example.com does not match \s+ in the regex.

@cgsmith cgsmith self-assigned this Dec 8, 2015
@cgsmith cgsmith added this to the 1.0.2 milestone Dec 8, 2015
@cgsmith
Copy link
Collaborator

cgsmith commented Jan 15, 2016

Merged in and tested - preparing for release.

@cgsmith cgsmith closed this Jan 15, 2016
cgsmith added a commit that referenced this pull request Jan 15, 2016
cgsmith added a commit that referenced this pull request Jan 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants