'Verifies whether the system has koji or brew installed, then loads
the configuration file that will be used to download the files.
:type cmd: string
:param cmd: Optional command name, either \'brew\' or \'koji\'. If not
set, get_default_command() is used and to look for
one of them.
:raise: ValueError'

def __init__(self, cmd=None):

    if (not KOJI_INSTALLED):
        raise ValueError('No    koji/brew    installed    on    the    machine')
    self.command = None
    self.config = None
    self.config_options = {}
    self.session = None
    if (cmd is None):
        self.command = self.get_default_command()
    else:
        self.command = cmd
    if (not self.is_command_valid()):
        raise ValueError(('Koji    command    "%s"    is    not    valid' % self.command))
    self.config = self.CONFIG_MAP[self.command]
    self.read_config()
    server_url = self.config_options['server']
    session_options = self.get_session_options()
    self.session = koji.ClientSession(server_url, session_options)
