Ensure the current project's .dctl.yml contains all the requisite keys.
173633
def check_settings!
      required_keys = %w(
        org
        project
      )

      required_keys.each do |key|
        unless Settings.send key
          error = "Config is missing required key '#{key}'. Please add it " \
            "to #{config_path} and try again."
          error += "\n\nFor more info, see https://github.com/jutonz/dctl_rb#required-keys"
          puts Rainbow(error).red
          exit 1
        end
      end
    end
558475
def initialize_key_source
      detect_key_source
      if args.require_key? && !self.key
        log :error, 'Unable to determine the key, which appears to be required with current args'
        raise Sym::Errors::NoPrivateKeyFound, 'Private key is required when ' + (self.action ? self.action.to_s + 'ypting' : provided_flags.join(', '))
      end
      log :debug, "initialize_key_source: detected key ends with [...#{(key ? key[-5..-1] : 'nil').bold.magenta}]"
      log :debug, "opts: #{self.provided_value_options.to_s.green.bold}"
      log :debug, "flags: #{self.provided_flags.to_s.green.bold}"
    end
1158799
protected function checkDeprecatedKeys() {
    $deprecated_keys = [
      'project.hash_salt',
      'project.profile.contrib',
      'project.vendor',
      'project.description',
      'project.themes',
      'hosting',
    ];
    $deprecated_keys_exist = FALSE;
    $outcome = [];
    foreach ($deprecated_keys as $deprecated_key) {
      if ($this->getConfigValue($deprecated_key)) {
        $outcome[] = "The '$deprecated_key' key is deprecated. Please remove it from blt.yml.";
        $deprecated_keys_exist = TRUE;
      }
    }

    if ($deprecated_keys_exist) {
      $this->logProblem(__FUNCTION__ . ':keys', $outcome, 'comment');
    }
  }
820375
def match_keys
      values.each do |v|
        Textoken.expression_err("#{v}: is not permitted.") unless yaml.key?(v)
        add_regexps(yaml[v])
      end
    end
135329
protected function mungeProjectYml() {
    $this->say("Merging BLT's <comment>blt.yml</comment> template with your project's <comment>blt/blt.yml</comment>...");
    // Values in the project's existing blt.yml file will be preserved and
    // not overridden.
    $repo_project_yml = $this->getConfigValue('blt.config-files.project');
    $template_project_yml = $this->getConfigValue('blt.root') . '/template/blt/blt.yml';
    $munged_yml = YamlMunge::mungeFiles($template_project_yml, $repo_project_yml);
    try {
      YamlMunge::writeFile($repo_project_yml, $munged_yml);
    }
    catch (\Exception $e) {
      throw new BltException("Could not update $repo_project_yml.");
    }
  }
924180
def check_yaml_configs(configs, key):
    
    diagnostic = {}
    for i in configs:
        for fname in i:
            with open(fname) as stream:
                try:
                    res = yaml.load(stream, Loader=UnsafeLoader)
                    msg = 'ok'
                except yaml.YAMLError as err:
                    stream.seek(0)
                    res = yaml.load(stream, Loader=BaseLoader)
                    if err.context == 'while constructing a Python object':
                        msg = err.problem
                    else:
                        msg = 'error'
                finally:
                    try:
                        diagnostic[res[key]['name']] = msg
                    except (KeyError, TypeError):
                        # this object doesn't have a 'name'
                        pass
    return diagnostic
1135807
def _preprocess_yml(path):
    """"""
    with open(path) as f:
        tmp_yaml = f.read()
    return re.sub(r"unicode", "str", tmp_yaml)
1358530
def check_requirements(dist, attr, value):
    """"""
    try:
        list(pkg_resources.parse_requirements(value))
    except (TypeError,ValueError):
        raise DistutilsSetupError(
            "%r must be a string or list of strings "
            "containing valid project/version requirement specifiers" % (attr,)
        )
1112923
def freeze(plugins_directory):
    '''
    
    '''
    # Check existing version (if any).
    package_versions = []
    for plugin_path_i in plugins_directory.dirs():
        try:
            plugin_metadata = yaml.load(plugin_path_i
                                        .joinpath('properties.yml').bytes())
            if plugin_path_i.name != plugin_metadata['package_name']:
                continue
            package_versions.append((plugin_metadata['package_name'],
                                     plugin_metadata['version']))
        except:
            continue
    return ['%s==%s' % v for v in package_versions]
277078
def load styles
      styles += '.yml' unless styles =~ /\.ya?ml$/
      styles = File.join(File.dirname(__FILE__), "styles", styles) unless File.exist? styles
      YAML.load_file(styles).inject({}) do |h, (key, value)|
        value = { :match => value['match'], :style => value['style'] }
        h.merge key.to_sym => value
      end
    end
512565
function(key){
			var wildCardMatch = key.match(PACKAGE_DOT_STAR);
			if (wildCardMatch){
				packages[wildCardMatch[1]].forEach(loadComponent);
			} else {
				if (key in registry) resolveDeps(registry[key]);
				else throw new Error('Missing key: ' + key);
			}
		}
498996
def _validate_dependencies_met():
    
    # Method added in `cryptography==1.1`; not available in older versions
    from cryptography.x509.extensions import Extensions
    if getattr(Extensions, "get_extension_for_class", None) is None:
        raise ImportError("'cryptography' module missing required functionality.  "
                          "Try upgrading to v1.3.4 or newer.")

    # pyOpenSSL 0.14 and above use cryptography for OpenSSL bindings. The _x509
    # attribute is only present on those versions.
    from OpenSSL.crypto import X509
    x509 = X509()
    if getattr(x509, "_x509", None) is None:
        raise ImportError("'pyOpenSSL' module missing required functionality. "
                          "Try upgrading to v0.14 or newer.")
283018
def ensureKeysAreSetup(self):
        
        if not areKeysSetup(self.name, self.keys_dir):
            raise REx(REx.reason.format(self.name) + self.keygenScript)
1296108
def needs_repl_key(self):
        
        cluster = self.get_cluster()
        return (self.supports_repl_key() and
                cluster is not None and cluster.get_repl_key() is not None)
795293
def check(self, radl):
        """"""

        SIMPLE_FEATURES = {
            "host": (str, None),
            "credentials.username": (str, None),
            "credentials.password": (str, None),
            "credentials.private_key": (str, None)
        }
        self.check_simple(SIMPLE_FEATURES, radl)

        if not self.getHost():
            raise RADLParseException("Ansible host must have a host", line=self.line)
        (username, password, private_key) = self.getCredentialValues()
        if not username:
            raise RADLParseException("Ansible host must have a credentials.username", line=self.line)
        if not password and not private_key:
            raise RADLParseException("Ansible host must have a credentials.password or credentials.private_key",
                                     line=self.line)
1029287
def save_all(yaml_dicts, filepath):
    '''
    
    '''
    yamldict.dump_all(yaml_dicts, open(filepath, 'w'),
                      default_flow_style=False)
521758
def _validate_markdown(self, expfile):
        ''''''

        try:
            import yaml
        except:
            bot.error('Python yaml is required for testing yml/markdown files.')
            sys.exit(1)

        self.metadata = {}
        uid = os.path.basename(expfile).strip('.md')
     
        if os.path.exists(expfile):
            with open(expfile, "r") as stream:
                docs = yaml.load_all(stream)
                for doc in docs:
                    if isinstance(doc,dict):
                        for k,v in doc.items():
                            print('%s: %s' %(k,v))
                            self.metadata[k] = v
            self.metadata['uid'] = uid
       
            fields = ['github', 'preview', 'name', 'layout',
                      'tags', 'uid', 'maintainer']

            # Tests for all fields
            for field in fields:
                if field not in self.metadata:
                    return False
                if self.metadata[field] in ['',None]:
                    return False

            if 'github' not in self.metadata['github']:
                return notvalid('%s: not a valid github repository' % name)
            if not isinstance(self.metadata['tags'],list):
                return notvalid('%s: tags must be a list' % name)
            if not re.search("(\w+://)(.+@)*([\w\d\.]+)(:[\d]+){0,1}/*(.*)", self.metadata['github']):
                return notvalid('%s is not a valid URL.' %(self.metadata['github']))

        return True