Пример #1
0
def initialize(context):
    """
    :type context: pulp.client.extensions.core.ClientContext
    """
    node_section = ensure_node_section(context.cli)
    node_section.add_command(NodeListCommand(context))
    node_section.add_command(NodeActivateCommand(context))
    node_section.add_command(NodeDeactivateCommand(context))
    node_section.add_command(NodeBindCommand(context))
    node_section.add_command(NodeUnbindCommand(context))

    repo_section = node_section.create_subsection(REPO_NAME, REPO_DESC)
    repo_section.add_command(NodeRepoEnableCommand(context))
    repo_section.add_command(NodeRepoDisableCommand(context))
    repo_section.add_command(NodeListRepositoriesCommand(context))
    repo_section.add_command(NodeRepoPublishCommand(context))

    sync_section = node_section.create_subsection(SYNC_NAME, SYNC_DESC)
    sync_section.add_command(NodeUpdateCommand(context))

    schedules_section = sync_section.create_subsection(SCHEDULES_NAME,
                                                       SCHEDULES_DESC)
    schedules_section.add_command(
        sync_schedules.NodeCreateScheduleCommand(context))
    schedules_section.add_command(
        sync_schedules.NodeDeleteScheduleCommand(context))
    schedules_section.add_command(
        sync_schedules.NodeUpdateScheduleCommand(context))
    schedules_section.add_command(
        sync_schedules.NodeListScheduleCommand(context))
    schedules_section.add_command(sync_schedules.NodeNextRunCommand(context))
 def test_next_run_command(self):
     command = sync_schedules.NodeNextRunCommand(self.context)
     self.assertTrue(isinstance(command, NextRunCommand))
     self.assertTrue(NODE_ID_OPTION in command.options)
     self.assertEqual(command.description, sync_schedules.DESC_NEXT_RUN)
     self.assertTrue(
         isinstance(command.strategy,
                    sync_schedules.NodeSyncScheduleStrategy))