'Process non-object based commands like "sync" and "hardlink"'

def direct_command(self, action_name):

    task_id = (-1)
    self.parser.set_usage(('Usage:    %%prog    %s    [options]' % action_name))
    if (action_name == 'buildiso'):
        defaultiso = os.path.join(os.getcwd(), 'generated.iso')
        self.parser.add_option('--iso', dest='iso', default=defaultiso, help='(OPTIONAL)    output    ISO    to    this    file')
        self.parser.add_option('--profiles', dest='profiles', help='(OPTIONAL)    use    these    profiles    only')
        self.parser.add_option('--systems', dest='systems', help='(OPTIONAL)    use    these    systems    only')
        self.parser.add_option('--tempdir', dest='buildisodir', help='(OPTIONAL)    working    directory')
        self.parser.add_option('--distro', dest='distro', help='(OPTIONAL)    used    with    --standalone    and    --airgapped    to    create    a    distro-based    ISO    including    all    associated    profiles/systems')
        self.parser.add_option('--standalone', dest='standalone', action='store_true', help='(OPTIONAL)    creates    a    standalone    ISO    with    all    required    distro    files,    but    without    any    added    repos')
        self.parser.add_option('--airgapped', dest='airgapped', action='store_true', help='(OPTIONAL)    creates    a    standalone    ISO    with    all    distro    and    repo    files    for    disconnected    system    installation')
        self.parser.add_option('--source', dest='source', help='(OPTIONAL)    used    with    --standalone    to    specify    a    source    for    the    distribution    files')
        self.parser.add_option('--exclude-dns', dest='exclude_dns', action='store_true', help='(OPTIONAL)    prevents    addition    of    name    server    addresses    to    the    kernel    boot    options')
        self.parser.add_option('--mkisofs-opts', dest='mkisofs_opts', help='(OPTIONAL)    extra    options    for    mkisofs')
        (options, args) = self.parser.parse_args()
        task_id = self.start_task('buildiso', options)
    elif (action_name == 'replicate'):
        self.parser.add_option('--master', dest='master', help='Cobbler    server    to    replicate    from.')
        self.parser.add_option('--port', dest='port', help='Remote    port.')
        self.parser.add_option('--distros', dest='distro_patterns', help='patterns    of    distros    to    replicate')
        self.parser.add_option('--profiles', dest='profile_patterns', help='patterns    of    profiles    to    replicate')
        self.parser.add_option('--systems', dest='system_patterns', help='patterns    of    systems    to    replicate')
        self.parser.add_option('--repos', dest='repo_patterns', help='patterns    of    repos    to    replicate')
        self.parser.add_option('--image', dest='image_patterns', help='patterns    of    images    to    replicate')
        self.parser.add_option('--mgmtclasses', dest='mgmtclass_patterns', help='patterns    of    mgmtclasses    to    replicate')
        self.parser.add_option('--packages', dest='package_patterns', help='patterns    of    packages    to    replicate')
        self.parser.add_option('--files', dest='file_patterns', help='patterns    of    files    to    replicate')
        self.parser.add_option('--omit-data', dest='omit_data', action='store_true', help='do    not    rsync    data')
        self.parser.add_option('--sync-all', dest='sync_all', action='store_true', help='sync    all    data')
        self.parser.add_option('--prune', dest='prune', action='store_true', help='remove    objects    (of    all    types)    not    found    on    the    master')
        self.parser.add_option('--use-ssl', dest='use_ssl', action='store_true', help='use    ssl    to    access    the    Cobbler    master    server    api')
        (options, args) = self.parser.parse_args()
        task_id = self.start_task('replicate', options)
    elif (action_name == 'aclsetup'):
        self.parser.add_option('--adduser', dest='adduser', help='give    acls    to    this    user')
        self.parser.add_option('--addgroup', dest='addgroup', help='give    acls    to    this    group')
        self.parser.add_option('--removeuser', dest='removeuser', help='remove    acls    from    this    user')
        self.parser.add_option('--removegroup', dest='removegroup', help='remove    acls    from    this    group')
        (options, args) = self.parser.parse_args()
        task_id = self.start_task('aclsetup', options)
    elif (action_name == 'version'):
        version = self.remote.extended_version()
        print ('Cobbler    %s' % version['version'])
        print ('        source:    %s,    %s' % (version['gitstamp'], version['gitdate']))
        print ('        build    time:    %s' % version['builddate'])
    elif (action_name == 'hardlink'):
        (options, args) = self.parser.parse_args()
        task_id = self.start_task('hardlink', options)
    elif (action_name == 'reserialize'):
        (options, args) = self.parser.parse_args()
        task_id = self.start_task('reserialize', options)
    elif (action_name == 'status'):
        (options, args) = self.parser.parse_args()
        print self.remote.get_status('text', self.token)
    elif (action_name == 'validate-autoinstalls'):
        (options, args) = self.parser.parse_args()
        task_id = self.start_task('validate_autoinstall_files', options)
    elif (action_name == 'get-loaders'):
        self.parser.add_option('--force', dest='force', action='store_true', help='overwrite    any    existing    content    in    /var/lib/cobbler/loaders')
        (options, args) = self.parser.parse_args()
        task_id = self.start_task('dlcontent', options)
    elif (action_name == 'import'):
        self.parser.add_option('--arch', dest='arch', help='OS    architecture    being    imported')
        self.parser.add_option('--breed', dest='breed', help='the    breed    being    imported')
        self.parser.add_option('--os-version', dest='os_version', help='the    version    being    imported')
        self.parser.add_option('--path', dest='path', help='local    path    or    rsync    location')
        self.parser.add_option('--name', dest='name', help="name,    ex    'RHEL-5'")
        self.parser.add_option('--available-as', dest='available_as', help="tree    is    here,    don't    mirror")
        self.parser.add_option('--autoinstall', dest='autoinstall_file', help='assign    this    autoinstall    file')
        self.parser.add_option('--rsync-flags', dest='rsync_flags', help='pass    additional    flags    to    rsync')
        (options, args) = self.parser.parse_args()
        if (options.path and ('rsync://' not in options.path)):
            options.path = os.path.abspath(options.path)
        task_id = self.start_task('import', options)
    elif (action_name == 'reposync'):
        self.parser.add_option('--only', dest='only', help='update    only    this    repository    name')
        self.parser.add_option('--tries', dest='tries', help='try    each    repo    this    many    times', default=1)
        self.parser.add_option('--no-fail', dest='nofail', help="don't    stop    reposyncing    if    a    failure    occurs", action='store_true')
        (options, args) = self.parser.parse_args()
        task_id = self.start_task('reposync', options)
    elif (action_name == 'aclsetup'):
        (options, args) = self.parser.parse_args()
        task_id = self.start_task('aclsetup', options)
    elif (action_name == 'check'):
        results = self.remote.check(self.token)
        ct = 0
        if (len(results) > 0):
            print 'The    following    are    potential    configuration    items    that    you    may    want    to    fix:\n'
            for r in results:
                ct += 1
                print ('%s:    %s' % (ct, r))
            print "\nRestart    cobblerd    and    then    run    'cobbler    sync'    to    apply    changes."
        else:
            print 'No    configuration    problems    found.        All    systems    go.'
    elif (action_name == 'sync'):
        (options, args) = self.parser.parse_args()
        self.parser.add_option('--verbose', dest='verbose', action='store_true', help='run    sync    with    more    output')
        task_id = self.start_task('sync', options)
    elif (action_name == 'report'):
        (options, args) = self.parser.parse_args()
        print 'distros:\n=========='
        report_items(self.remote, 'distro')
        print '\nprofiles:\n=========='
        report_items(self.remote, 'profile')
        print '\nsystems:\n=========='
        report_items(self.remote, 'system')
        print '\nrepos:\n=========='
        report_items(self.remote, 'repo')
        print '\nimages:\n=========='
        report_items(self.remote, 'image')
        print '\nmgmtclasses:\n=========='
        report_items(self.remote, 'mgmtclass')
        print '\npackages:\n=========='
        report_items(self.remote, 'package')
        print '\nfiles:\n=========='
        report_items(self.remote, 'file')
    elif (action_name == 'list'):
        (options, args) = self.parser.parse_args()
        print 'distros:'
        list_items(self.remote, 'distro')
        print '\nprofiles:'
        list_items(self.remote, 'profile')
        print '\nsystems:'
        list_items(self.remote, 'system')
        print '\nrepos:'
        list_items(self.remote, 'repo')
        print '\nimages:'
        list_items(self.remote, 'image')
        print '\nmgmtclasses:'
        list_items(self.remote, 'mgmtclass')
        print '\npackages:'
        list_items(self.remote, 'package')
        print '\nfiles:'
        list_items(self.remote, 'file')
    else:
        print ('No    such    command:    %s' % action_name)
        sys.exit(1)
    if (task_id != (-1)):
        self.print_task(task_id)
        self.follow_task(task_id)
    return True
