Merge pull request #1931 from Chris-Peterson444/cdrom-metadata
Move metadata collection to Curtin
This commit is contained in:
commit
0ba9dc9ed6
|
@ -70,7 +70,7 @@ parts:
|
||||||
|
|
||||||
source: https://git.launchpad.net/curtin
|
source: https://git.launchpad.net/curtin
|
||||||
source-type: git
|
source-type: git
|
||||||
source-commit: a5b815bc688fcc18877ef2cd05ea56bc58d7fe00
|
source-commit: 7db312f27463e7f56ede4778e5cfac91a0db14a2
|
||||||
|
|
||||||
override-pull: |
|
override-pull: |
|
||||||
craftctl default
|
craftctl default
|
||||||
|
|
|
@ -486,13 +486,6 @@ class SubiquityModel:
|
||||||
os.makedirs(os.path.dirname(path), exist_ok=True)
|
os.makedirs(os.path.dirname(path), exist_ok=True)
|
||||||
write_file(path, content, mode=mode)
|
write_file(path, content, mode=mode)
|
||||||
|
|
||||||
def _media_info(self):
|
|
||||||
if os.path.exists("/cdrom/.disk/info"):
|
|
||||||
with open("/cdrom/.disk/info") as fp:
|
|
||||||
return fp.read()
|
|
||||||
else:
|
|
||||||
return "media-info"
|
|
||||||
|
|
||||||
def _machine_id(self):
|
def _machine_id(self):
|
||||||
with open("/etc/machine-id") as fp:
|
with open("/etc/machine-id") as fp:
|
||||||
return fp.read()
|
return fp.read()
|
||||||
|
@ -525,11 +518,6 @@ class SubiquityModel:
|
||||||
"content": self._machine_id(),
|
"content": self._machine_id(),
|
||||||
"permissions": 0o444,
|
"permissions": 0o444,
|
||||||
},
|
},
|
||||||
"media_info": {
|
|
||||||
"path": "var/log/installer/media-info",
|
|
||||||
"content": self._media_info(),
|
|
||||||
"permissions": 0o644,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -180,7 +180,6 @@ class TestSubiquityModel(unittest.IsolatedAsyncioTestCase):
|
||||||
for model in model_no_proxy, model_proxy:
|
for model in model_no_proxy, model_proxy:
|
||||||
config = model.render()
|
config = model.render()
|
||||||
self.assertConfigWritesFile(config, "etc/machine-id")
|
self.assertConfigWritesFile(config, "etc/machine-id")
|
||||||
self.assertConfigWritesFile(config, "var/log/installer/media-info")
|
|
||||||
|
|
||||||
def test_storage_version(self):
|
def test_storage_version(self):
|
||||||
model = self.make_model()
|
model = self.make_model()
|
||||||
|
|
Loading…
Reference in New Issue