def _import(self, argv): if len(argv) != 2: raise ArgumentException("Wrong number of arguments") org = self._client.organizations().get(argv[0]) imp = Import(update_existing=self._config.options.update_existing) imp.import_platform(org, argv[1])
def _import(self, argv): if len(argv) != 2: raise ArgumentException("Wrong number of arguments") org = self._client.get_organization(argv[0]) imp = Import() imp.import_application(org, argv[1])
def upload_apps(org): importer = Import() for app in config['applications']: print "Uploading application %s" % app["name"] try: importer.import_application(org, app['name']) except Exception as e: print "Failed to upload application %s " \ "with error %s." % (app['name'], e)
def setup(): # Connect to the ComodIT API client = Client(config.endpoint, config.username, config.password) org = client.get_organization(config.organization) print "Setting up ComodIT..." # Create environment (if not already present) try: org.environments().create("Cluster", "Environment containing the web cluster.") except: pass # Import applications importer = Import() importer.import_application(org, 'db') importer.import_application(org, 'lb') importer.import_application(org, 'web') print "Done."
def setup(): # Connect to the ComodIT API client = Client(config.endpoint, config.username, config.password) org = client.get_organization(config.organization) print "Setting up ComodIT..." # Create environment (if not already present) try: org.environments().create("Render Farm", "Environment containing the render farm.") except: pass # Import applications importer = Import() importer.import_application(org, 'nfs-server') importer.import_application(org, 'nfs-client') importer.import_application(org, 'blender') print "Done."
def setup(): # Connect to the ComodIT API client = Client(config['api'], config['username'], config['password']) org = client.get_organization(config['organization']) print "Setting up ComodIT..." # Create environment (if not already present) try: org.environments().create("Development", "Development environment.") except: pass importer = Import() for app in config['applications']: print "Uploading application %s" % app["name"] try: importer.import_application(org, app['name']) except Exception as e: print "Failed to upload applicatin %s with error %s." % (app['name'], e) print "Done."
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)
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)
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 org = self._client.organizations().get(argv[0]) env = self._client.environments(argv[0]).get(argv[1]) if len(argv) < 3: raise ArgumentException("Wrong number of arguments") importer = Import(self._config.options.skip_conflict, queue_actions=True, with_instances=self._config.options.with_instances) importer.import_full_host(org, env, argv[2]) 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 host. There are conflicts. Use --skip-conflict to force" )
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_platform(self._parent, opts.path)
def setup(): # Connect to the ComodIT API client = Client(config.endpoint, config.username, config.password) org = client.get_organization(config.organization) print "Setting up ComodIT..." # Create environment (if not already present) try: org.environments().create("Openshift", "Environment containing the openshift cluster.") except: pass # Import applications importer = Import() importer.import_application(org, 'openshift-bind-server') importer.import_application(org, 'openshift-broker') importer.import_application(org, 'openshift-client') importer.import_application(org, 'openshift-dhcp-dns-config') importer.import_application(org, 'openshift-mcollective-client') importer.import_application(org, 'openshift-mcollective-node') importer.import_application(org, 'openshift-mongodb') importer.import_application(org, 'openshift-node') importer.import_application(org, 'openshift-cartridges') importer.import_application(org, 'openshift-rabbitmq-server') # Update repositories if hasattr(config, "repo"): updaterepo(org.get_application("openshift-broker"), config.repo) updaterepo(org.get_application("openshift-node"), config.repo) updaterepo(org.get_application("openshift-client"), config.repo) # Append cartridges if hasattr(config, "cartridges"): app = org.get_application("openshift-cartridges") for cart in config.cartridges: app.add_package(Package({"name": cart})) app.update() print "Done."