Пример #1
0
    def _import(self, argv):
        """
        Pushes local data to comodit server. Data may include applications,
        distributions, platforms, organizations, environments and hosts.
        Local data are automatically imported if no collision with remote data
        is detected. In case of collision, 'force' option can be used to still
        import data.
        """
        self._options = self._config.options

        if len(argv) < 1:
            raise ArgumentException("Wrong number of arguments")
        self._root = argv[0]

        importer = Import(self._config.options.skip_conflict,
                          queue_actions=True,
                          with_instances=self._config.options.with_instances)
        importer.import_organization(self._client, self._root)

        if self._config.options.dry_run:
            importer.display_queue(show_only_conflicts=False)

        elif (importer.no_conflict() or self._config.options.skip_conflict):
            importer.execute_queue()
        else:
            importer.display_queue(show_only_conflicts=True)
            print(
                "Impossible to import organization. There are conflicts. Use --skip-conflict to force"
            )
Пример #2
0
    def _import(self, argv):
        """
        Pushes local data to comodit server. Data may include applications,
        distributions, platforms, organizations, environments and hosts.
        Local data are automatically imported if no collision with remote data
        is detected. In case of collision, 'force' option can be used to still
        import data.
        """
        self._options = self._config.options

        if len(argv) < 1:
            raise ArgumentException("Wrong number of arguments")
        self._root = argv[0]

        importer = Import(self._config.options.skip_conflict, queue_actions=True, with_instances=self._config.options.with_instances)
        importer.import_organization(self._client, self._root)

        if (importer.no_conflict() or self._config.options.skip_conflict) and not self._config.options.dry_run:
            importer.execute_queue()
        else:
            importer.display_queue(show_only_conflicts = True)
Пример #3
0
    def _import(self, argv):
        """
        Pushes local data to comodit server. Data may include applications,
        distributions, platforms, organizations, environments and hosts.
        Local data are automatically imported if no collision with remote data
        is detected. In case of collision, 'force' option can be used to still
        import data.
        """
        self._options = globals.options

        if len(argv) < 1:
            raise ArgumentException("Wrong number of arguments")
        self._root = argv[0]

        importer = Import(globals.options.skip_conflict, True)
        importer.import_organization(self._client, self._root)

        if (importer.no_conflict() or
                globals.options.skip_conflict) and not globals.options.dry_run:
            importer.execute_queue()
        else:
            importer.display_queue(show_only_conflicts=True)
Пример #4
0
    def import_entity(self, opts):
        if opts.path is None:
            raise Exception("You must provide the path to the input folder")

        imp = Import(opts.skip_conflicts, opts.dry_run)
        imp.import_organization(self._client, opts.path)
Пример #5
0
    def import_entity(self, opts):
        if opts.path is None:
            raise Exception("You must provide the path to the input folder")

        imp = Import(opts.skip_conflicts, opts.dry_run)
        imp.import_organization(self._client, opts.path)