Strip key/values of external quotes

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2023-12-13 06:18:05 -05:00
parent c324dbb8b4
commit 9d0da9d0fd
5 changed files with 11 additions and 4 deletions

View File

@ -611,7 +611,7 @@ func (f *UnitFile) Lookup(groupName string, key string) (string, bool) {
return "", false
}
return strings.TrimRightFunc(v, unicode.IsSpace), true
return strings.Trim(strings.TrimRightFunc(v, unicode.IsSpace), "\""), true
}
// Lookup the last instance of a key and convert the value to a bool

View File

@ -1,6 +1,6 @@
[Container]
Image=localhost/imagename
## assert-podman-args "--health-cmd" "\"hello world\""
## assert-podman-args "--health-cmd" "hello world"
HealthCmd="hello world"
## assert-podman-args "--health-interval" "1m"
HealthInterval=1m

View File

@ -1,4 +1,4 @@
[Container]
Image=localhost/imagename
## assert-podman-args "--hostname" "\"quadlet-host\""
HostName="quadlet-host"
## assert-podman-args "--hostname" "quadlet-host"
HostName=quadlet-host

View File

@ -0,0 +1,6 @@
## assert-podman-final-args localhost/imagename
## assert-podman-args --name=RemoveQuotes\"Name
[Container]
Image="localhost/imagename"
ContainerName="RemoveQuotes"Name"

View File

@ -794,6 +794,7 @@ BOGUS=foo
Entry("ports.container", "ports.container", 0, ""),
Entry("ports_ipv6.container", "ports_ipv6.container", 0, ""),
Entry("pull.container", "pull.container", 0, ""),
Entry("quotes.container", "quotes.container", 0, ""),
Entry("readonly.container", "readonly.container", 0, ""),
Entry("readonly-tmpfs.container", "readonly-tmpfs.container", 0, ""),
Entry("readonly-notmpfs.container", "readonly-notmpfs.container", 0, ""),