Re: [Cloud-init-dev] [Merge] ~rjschwei/cloud-init:breakLink into cloud-init:master

2019-10-24 Thread Dan Watkins
One inline question, probably for my own edification.  Thanks!

Diff comments:

> diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py
> index e381596..44a2f11 100644
> --- a/cloudinit/net/sysconfig.py
> +++ b/cloudinit/net/sysconfig.py
> @@ -708,6 +708,12 @@ class Renderer(renderer.Renderer):
>  resolv_content = self._render_dns(network_state,
>existing_dns_path=dns_path)
>  if resolv_content:
> +# netconfig checks if the resolv file is a link and if that

Forgive my ignorance about the stack here, Robert, but is there anything we can 
do to configure DNS in netconfig itself so that even if it does assume control 
it won't break the configuration we want?

> +# is true it assumes it is in controil of the file and
> +# will clobber our changes, break the link to ensure the user
> +# configuration sticks
> +if os.path.islink(dns_path):
> +os.unlink(dns_path)
>  util.write_file(dns_path, resolv_content, file_mode)
>  if self.networkmanager_conf_path:
>  nm_conf_path = util.target_path(target,


-- 
https://code.launchpad.net/~rjschwei/cloud-init/+git/cloud-init/+merge/374517
Your team cloud-init Commiters is requested to review the proposed merge of 
~rjschwei/cloud-init:breakLink into cloud-init:master.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Cloud-init-dev] [Merge] ~rjschwei/cloud-init:breakLink into cloud-init:master

2019-10-22 Thread Server Team CI bot
Review: Approve continuous-integration

PASSED: Continuous integration, rev:79a7217061eac26d09bff4b00ac7f6a0552ceee0
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1225/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
IN_PROGRESS: Declarative: Post Actions


Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1225//rebuild
-- 
https://code.launchpad.net/~rjschwei/cloud-init/+git/cloud-init/+merge/374517
Your team cloud-init Commiters is requested to review the proposed merge of 
~rjschwei/cloud-init:breakLink into cloud-init:master.

___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp


[Cloud-init-dev] [Merge] ~rjschwei/cloud-init:breakLink into cloud-init:master

2019-10-22 Thread Robert Schweikert
Robert Schweikert has proposed merging ~rjschwei/cloud-init:breakLink into 
cloud-init:master.

Requested reviews:
  cloud-init Commiters (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~rjschwei/cloud-init/+git/cloud-init/+merge/374517

If /etc/resolv.conf is a symlink break the link to avoid having our changes 
clobbered by netconfig
  + netconfig maintains a symlink of /etc/resolv.conf and will write the
traget of this symlink unconditionally. If the symlink persists when
cloud-init writes the dns information the cloud-init written user
configuration gets lost

-- 
Your team cloud-init Commiters is requested to review the proposed merge of 
~rjschwei/cloud-init:breakLink into cloud-init:master.
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py
index e381596..44a2f11 100644
--- a/cloudinit/net/sysconfig.py
+++ b/cloudinit/net/sysconfig.py
@@ -708,6 +708,12 @@ class Renderer(renderer.Renderer):
 resolv_content = self._render_dns(network_state,
   existing_dns_path=dns_path)
 if resolv_content:
+# netconfig checks if the resolv file is a link and if that
+# is true it assumes it is in controil of the file and
+# will clobber our changes, break the link to ensure the user
+# configuration sticks
+if os.path.islink(dns_path):
+os.unlink(dns_path)
 util.write_file(dns_path, resolv_content, file_mode)
 if self.networkmanager_conf_path:
 nm_conf_path = util.target_path(target,
___
Mailing list: https://launchpad.net/~cloud-init-dev
Post to : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp