Permalink
Browse files

Do not emit cloud-init.disabled; cloud-init only runs if datasource i…

…s present
  • Loading branch information...
1 parent dbe8771 commit 3e83b3aa281f02bce9a230a812ad4f02d0d66c22 @raharper committed Mar 27, 2017
Showing with 1 addition and 7 deletions.
  1. +0 −3 image/image.go
  2. +1 −4 image/image_test.go
View
@@ -232,9 +232,6 @@ func installCloudConfig(gadgetDir string) error {
if osutil.FileExists(cloudConfig) {
dst := filepath.Join(cloudDir, "cloud.cfg")
err = osutil.CopyFile(cloudConfig, dst, osutil.CopyFlagOverwrite)
- } else {
- dst := filepath.Join(cloudDir, "cloud-init.disabled")
- err = osutil.AtomicWriteFile(dst, nil, 0644, 0)
}
return err
}
View
@@ -551,9 +551,6 @@ func (s *imageSuite) TestBootstrapToRootDirLocalCoreBrandKernel(c *C) {
c.Assert(err, IsNil)
c.Check(m["snap_core"], Equals, "core_x1.snap")
- // check that cloud-init is setup correctly
- c.Check(osutil.FileExists(filepath.Join(rootdir, "etc/cloud/cloud-init.disabled")), Equals, true)
-
c.Check(s.stderr.String(), Equals, "WARNING: \"core\", \"required-snap1\" were installed from local snaps disconnected from a store and cannot be refreshed subsequently!\n")
}
@@ -662,7 +659,7 @@ func (s *imageSuite) TestInstallCloudConfigNoConfig(c *C) {
dirs.SetRootDir(targetDir)
err := image.InstallCloudConfig(emptyGadgetDir)
c.Assert(err, IsNil)
- c.Check(osutil.FileExists(filepath.Join(targetDir, "etc/cloud/cloud-init.disabled")), Equals, true)
+ c.Check(osutil.FileExists(filepath.Join(targetDir, "etc/cloud")), Equals, true)
}
func (s *imageSuite) TestInstallCloudConfigWithCloudConfig(c *C) {

0 comments on commit 3e83b3a

Please sign in to comment.