'filter the oc version output'

@staticmethod
def filter_versions(stdout):

    version_dict = {}
    version_search = ['oc', 'openshift', 'kubernetes']
    for line in stdout.strip().split('\n'):
        for term in version_search:
            if (not line):
                continue
            if line.startswith(term):
                version_dict[term] = line.split()[(-1)]
    if ('openshift' not in version_dict):
        version_dict['openshift'] = version_dict['oc']
    return version_dict
