- return LoadJson(msg)
-
-
-def SaltEqualTo(expected):
- """Helper salt verifier function that checks for equality.
-
- @type expected: string
- @param expected: expected salt
- @rtype: function
- @return: salt verifier that returns True if the target salt is "x"
-
- """
- return lambda salt: salt == expected
-
-
-def SaltIn(expected):
- """Helper salt verifier function that checks for equality.
-
- @type expected: collection
- @param expected: collection of possible valid salts
- @rtype: function
- @return: salt verifier that returns True if the salt is in the collection
-
- """
- return lambda salt: salt in expected
-
-
-def SaltInRange(min, max):
- """Helper salt verifier function that checks for equality.
-
- @type min: integer
- @param min: minimum salt value
- @type max: integer
- @param max: maximum salt value
- @rtype: function
- @return: salt verifier that returns True if the salt is in the min,max range
-
- """
- def _CheckSaltInRange(salt):
- try:
- i_salt = int(salt)
- except (TypeError, ValueError), err:
- return False
-
- return i_salt > min and i_salt < max