def config_check(name, passed, default, module):
 diff = DefaultVMConfig(passed, default)
 if len(diff.shallow_diff()):
  module.fail_json(msg=('Missing required key/pair [%s]. %s must contain %s' % (', '.join(diff.shallow_diff()), name, default)))
 if diff.recursive_diff():
  module.fail_json(msg=('Config mismatch for %s on %s' % (name, diff.recursive_diff())))
 return True

def config_check ( name , passed , default , module ) : diff = DefaultVMConfig ( passed , default ) if len ( diff . shallow_diff ( ) ) : module . fail_json ( msg = ( 'Missing required key/pair [%s]. %s must contain %s' % ( ', ' . join ( diff . shallow_diff ( ) ) , name , default ) ) ) if diff . recursive_diff ( ) : module . fail_json ( msg = ( 'Config mismatch for %s on %s' % ( name , diff . recursive_diff ( ) ) ) ) return True
checks that the dict passed for vm configuration matches the required interface declared at the top of __main__ .