'ensure all required arguments are present'

def _check_required_arguments(self, spec=None, param=None):

    missing = []
    if (spec is None):
        spec = self.argument_spec
    if (param is None):
        param = self.params
    for (k, v) in spec.items():
        required = v.get('required', False)
        if (required and (k not in param)):
            missing.append(k)
    if (len(missing) > 0):
        msg = ('missing    required    arguments:    %s' % ','.join(missing))
        if self._options_context:
            msg += ('    found    in    %s' % '    ->    '.join(self._options_context))
        self.fail_json(msg=msg)
