stages/rhsm.facts: create facts file in /etc
Instead of creating the file in /usr/share and symlinking to /etc, create it directly in /etc. This fixes an issue with SELinux labeling. The file in /usr/share does not get labelled correctly because it doesn't match the policy and causes issues with some tools (rhc). See rhbz#2147450.
This commit is contained in:
parent
d466d5d66a
commit
2efdbe0277
1 changed files with 2 additions and 9 deletions
|
|
@ -22,21 +22,14 @@ SCHEMA = r"""
|
||||||
|
|
||||||
|
|
||||||
def main(tree, options):
|
def main(tree, options):
|
||||||
path = os.path.join(tree, "usr/share/osbuild/self")
|
path = os.path.join(tree, "etc/rhsm/facts")
|
||||||
file = os.path.join(path, "rhsm.facts")
|
file = os.path.join(path, "osbuild.facts")
|
||||||
|
|
||||||
os.makedirs(path, exist_ok=True)
|
os.makedirs(path, exist_ok=True)
|
||||||
|
|
||||||
with open(file, "x", encoding="utf8") as f:
|
with open(file, "x", encoding="utf8") as f:
|
||||||
json.dump(options["facts"], f)
|
json.dump(options["facts"], f)
|
||||||
|
|
||||||
os.makedirs(os.path.join(tree, "etc/rhsm/facts"), exist_ok=True)
|
|
||||||
|
|
||||||
os.symlink(
|
|
||||||
"/usr/share/osbuild/self/rhsm.facts",
|
|
||||||
os.path.join(tree, "etc/rhsm/facts/osbuild.facts"),
|
|
||||||
)
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue