Skip to content

Commit

Permalink
Use more concise not-in-recovery syntax
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com>
  • Loading branch information
anmazzotti committed Aug 5, 2024
1 parent a212d9e commit 48a4555
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (n *nmstateConfigurator) GetNetworkConfigApplicator(networkConfig elemental
configApplicator.Stages = map[string][]schema.Stage{
"initramfs": {
schema.Stage{
If: "[ -f /run/elemental/active_mode ] || [ -f /run/elemental/passive_mode ]",
If: "[ ! -f /run/elemental/recovery_mode ]",
Files: yipFiles,
},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/network/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ var _ = Describe("network configurator", Label("network", "configurator"), func(
stage, found := applicator.Stages["initramfs"]
Expect(found).To(BeTrue(), "Config should be applied at initramfs stage")

Expect(stage[0].If).To(Equal("[ -f /run/elemental/active_mode ] || [ -f /run/elemental/passive_mode ]"), "Network config must be applied on active or passive systems only (not recovery)")
Expect(stage[0].If).To(Equal("[ ! -f /run/elemental/recovery_mode ]"), "Network config must be applied on active or passive systems only (not recovery)")
Expect(len(stage[0].Files)).To(Equal(2), "Two nmconnection files must have been copied")
Expect(stage[0].Files[0].Content).To(Equal("[connection]\nid=Wired connection 1\n"))
Expect(stage[0].Files[0].Path).To(Equal(filepath.Join(systemConnectionsDir, "wired1.nmconnection")))
Expand Down

0 comments on commit 48a4555

Please sign in to comment.