firstboot: do not overwrite any existing netplan config #1901

Merged
merged 1 commit into from Sep 14, 2016

Conversation

Projects
None yet
3 participants
Contributor

mwhudson commented Sep 13, 2016

Works around https://bugs.launchpad.net/snappy/+bug/1623119

Not sure if this is entirely appropriate but its probably an improvement.

@@ -69,16 +69,19 @@ network:
// be run as part of the config-changed hook and read the snap's
// config to determine the netplan config to write.
func InitialNetworkConfig() error {
+ // If the config is already present, don't overwrite it. See
+ // https://bugs.launchpad.net/snappy/+bug/1623119.
+ if _, err := os.Stat(netplanConfigFile); err == nil {
@mvo5

mvo5 Sep 14, 2016

Collaborator

You may consider using osutil.FileExists() for this, but I guess your version is more go-ish ;)

@mwhudson

mwhudson Sep 14, 2016

Contributor

Too long spent coding with only the standard library available? Would you like me to change it?

- return nil
+ return enable.Run()
@mvo5

mvo5 Sep 14, 2016

Collaborator

Aha, nice.

Collaborator

mvo5 commented Sep 14, 2016

👍

Collaborator

mvo5 commented Sep 14, 2016

Fwiw, I think the firstboot failure is actually an incorrect time that is very off in the dragonboard. This means that the assertion can not be checked because it is only valid within a certain timeframe.

Contributor

mwhudson commented Sep 14, 2016

Fwiw, I think the firstboot failure is actually an incorrect time that is very off in the dragonboard. This means that the assertion can not be checked because it is only valid within a certain timeframe.

I saw this happen in kvm with an image I'd made myself with a custom ubuntu-core snap too, is that expected?

Member

chipaca commented Sep 14, 2016

I'm wondering if we should delay starting things until the netplan config exists.

in any case, 👍

@mvo5 mvo5 merged commit b9030fd into snapcore:master Sep 14, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment