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,13 +784,14 @@ 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 $
{ remoteConfigFieldParsers = RemoteConfigParser
[ optionalStringParser externaltypeField { remoteConfigFieldParsers =
, trueFalseParser readonlyField False [ optionalStringParser externaltypeField
] , trueFalseParser readonlyField False
, remoteConfigRestPassthrough = const True ]
} , remoteConfigRestPassthrough = const True
}
{- When the remote supports LISTCONFIGS, only accept the ones it listed. {- When the remote supports LISTCONFIGS, only accept the ones it listed.
- When it does not, accept all configs. -} - When it does not, accept all configs. -}