always add the specialRemoteConfigParsers

Was not being added in some places, resulting in error messages about
encryption not being a valid field.
This commit is contained in:
Joey Hess 2020-01-17 17:13:44 -04:00
parent 2a4731216d
commit 5c58f86790
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -177,9 +177,8 @@ externalSetup _ mu _ c gc = do
-- Now that we have an external, ask it to LISTCONFIGS, -- Now that we have an external, ask it to LISTCONFIGS,
-- and re-parse the RemoteConfig strictly, so we can -- and re-parse the RemoteConfig strictly, so we can
-- error out if the user provided an unexpected config. -- error out if the user provided an unexpected config.
p <- strictRemoteConfigParser external either giveup return . parseRemoteConfig c'
let p' = addRemoteConfigParser specialRemoteConfigParsers p =<< strictRemoteConfigParser external
_ <- either giveup return $ parseRemoteConfig c' p'
handleRequest external INITREMOTE Nothing $ \resp -> case resp of handleRequest external INITREMOTE Nothing $ \resp -> case resp of
INITREMOTE_SUCCESS -> result () INITREMOTE_SUCCESS -> result ()
INITREMOTE_FAILURE errmsg -> Just $ giveup errmsg INITREMOTE_FAILURE errmsg -> Just $ giveup errmsg
@ -785,7 +784,8 @@ getInfoM external = (++)
{- All unknown configs are passed through in case the external program {- All unknown configs are passed through in case the external program
- uses them. -} - uses them. -}
lenientRemoteConfigParser :: RemoteConfigParser lenientRemoteConfigParser :: RemoteConfigParser
lenientRemoteConfigParser = RemoteConfigParser lenientRemoteConfigParser = addRemoteConfigParser specialRemoteConfigParsers $
RemoteConfigParser
{ remoteConfigFieldParsers = { remoteConfigFieldParsers =
[ optionalStringParser externaltypeField [ optionalStringParser externaltypeField
, trueFalseParser readonlyField False , trueFalseParser readonlyField False