Commit 7295a6dc authored by Hrvoje Ribicic's avatar Hrvoje Ribicic
Browse files

Allow the NIC VLAN to be set to an empty string



The NIC VLAN has previously not been modified via Haskell, causing the
INicParams class not to be used. With the recent job queue
refactorings, a modification definition is recorded, and for an empty
string (which is a legal default value) a crash happens. This patch
fixes this by allowing VLANS to be empty strings on the Haskell side.
Signed-off-by: default avatarHrvoje Ribicic <riba@google.com>
Reviewed-by: default avatarThomas Thrainer <thomasth@google.com>
parent 32933325
...@@ -337,7 +337,7 @@ $(buildObject "INicParams" "inic" ...@@ -337,7 +337,7 @@ $(buildObject "INicParams" "inic"
, optionalField $ simpleField C.inicMode [t| NonEmptyString |] , optionalField $ simpleField C.inicMode [t| NonEmptyString |]
, optionalField $ simpleField C.inicLink [t| NonEmptyString |] , optionalField $ simpleField C.inicLink [t| NonEmptyString |]
, optionalField $ simpleField C.inicName [t| NonEmptyString |] , optionalField $ simpleField C.inicName [t| NonEmptyString |]
, optionalField $ simpleField C.inicVlan [t| NonEmptyString |] , optionalField $ simpleField C.inicVlan [t| String |]
, optionalField $ simpleField C.inicBridge [t| NonEmptyString |] , optionalField $ simpleField C.inicBridge [t| NonEmptyString |]
]) ])
......
...@@ -88,7 +88,7 @@ instance Arbitrary OpCodes.DiskIndex where ...@@ -88,7 +88,7 @@ instance Arbitrary OpCodes.DiskIndex where
instance Arbitrary INicParams where instance Arbitrary INicParams where
arbitrary = INicParams <$> genMaybe genNameNE <*> genMaybe genName <*> arbitrary = INicParams <$> genMaybe genNameNE <*> genMaybe genName <*>
genMaybe genNameNE <*> genMaybe genNameNE <*> genMaybe genNameNE <*> genMaybe genNameNE <*>
genMaybe genNameNE <*> genMaybe genNameNE <*> genMaybe genNameNE <*> genMaybe genName <*>
genMaybe genNameNE genMaybe genNameNE
instance Arbitrary IDiskParams where instance Arbitrary IDiskParams where
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment