예제 #1
0
    def run(self):
        org_name = self.get_option('org')
        plan_name = self.get_option('name')

        plan = get_sync_plan(org_name, plan_name)

        self.api.delete(org_name, plan["id"])
        print _("Successfully deleted sync plan [ %s ]") % plan_name
        return os.EX_OK
예제 #2
0
    def run(self):
        org_name = self.get_option('org')
        plan_name = self.get_option('name')

        plan = get_sync_plan(org_name, plan_name)

        self.api.delete(org_name, plan["id"])
        print _("Successfully deleted sync plan [ %s ]") % plan_name
        return os.EX_OK
예제 #3
0
파일: product.py 프로젝트: skottler/katello
    def run(self):
        orgName  = self.get_option('org')
        prodName = self.get_option('name')
        planName = self.get_option('plan')

        prod = get_product(orgName, prodName)
        plan = get_sync_plan(orgName, planName)

        msg = self.api.set_sync_plan(orgName, prod['id'], plan['id'])
        print msg
        return os.EX_OK
예제 #4
0
    def run(self):
        orgName  = self.get_option('org')
        prodName = self.get_option('name')
        planName = self.get_option('plan')

        prod = get_product(orgName, prodName)
        plan = get_sync_plan(orgName, planName)

        msg = self.api.set_sync_plan(orgName, prod['id'], plan['id'])
        print msg
        return os.EX_OK
예제 #5
0
    def run(self):
        org_name = self.get_option('org')
        plan_name = self.get_option('name')

        plan = get_sync_plan(org_name, plan_name)

        self.printer.add_column('id')
        self.printer.add_column('name')
        self.printer.add_column('description', multiline=True)
        self.printer.add_column('sync_date', name=_("Start date"), formatter=format_date)
        self.printer.add_column('interval')

        self.printer.set_header(_("Sync Plan Info"))
        self.printer.print_item(plan)

        return os.EX_OK
예제 #6
0
    def run(self):
        org_name = self.get_option('org')
        plan_name = self.get_option('name')

        plan = get_sync_plan(org_name, plan_name)

        self.printer.add_column('id')
        self.printer.add_column('name')
        self.printer.add_column('description', multiline=True)
        self.printer.add_column('sync_date',
                                name=_("Start date"),
                                formatter=format_date)
        self.printer.add_column('interval')

        self.printer.set_header(_("Sync Plan Info"))
        self.printer.print_item(plan)

        return os.EX_OK
예제 #7
0
    def run(self):
        name        = self.get_option('name')
        new_name    = self.get_option('new_name')
        org_name    = self.get_option('org')
        description = self.get_option('description')
        interval    = self.get_option('interval')
        date        = self.get_option('date')
        time        = self.get_option('time')

        plan = get_sync_plan(org_name, name)

        if date != None and time != None:
            sync_date = self.parse_datetime(date, time)
        else:
            sync_date = None

        plan = self.api.update(org_name, plan["id"], new_name, sync_date, interval, description)
        print _("Successfully updated sync plan [ %s ]") % name
        return os.EX_OK
예제 #8
0
    def run(self):
        org_name = self.get_option('org')
        plan_name = self.get_option('name')

        plan = get_sync_plan(org_name, plan_name)
        if plan == None:
            return os.EX_DATAERR

        plan['start_date'] = format_date(plan['sync_date'])
        self.printer.addColumn('id')
        self.printer.addColumn('name')
        self.printer.addColumn('description', multiline=True)
        self.printer.addColumn('start_date')
        self.printer.addColumn('interval')

        self.printer.setHeader(_("Sync Plan Info"))
        self.printer.printItem(plan)

        return os.EX_OK
예제 #9
0
    def run(self):
        name = self.get_option('name')
        new_name = self.get_option('new_name')
        org_name = self.get_option('org')
        description = self.get_option('description')
        interval = self.get_option('interval')
        date = self.get_option('date')
        time = self.get_option('time')

        plan = get_sync_plan(org_name, name)

        if date != None and time != None:
            sync_date = self.parse_datetime(date, time)
        else:
            sync_date = None

        plan = self.api.update(org_name, plan["id"], new_name, sync_date,
                               interval, description)
        print _("Successfully updated sync plan [ %s ]") % name
        return os.EX_OK