def serialize(cls, instance, fields=None): from nailgun.objects.release import Release release_dict = \ super(ReleaseSerializer, cls).serialize(instance, fields) release_dict["is_deployable"] = Release.is_deployable(instance) # we always want to get orchestrator data even it's a default one release_dict["orchestrator_data"] = \ Release.get_orchestrator_data_dict(instance) return release_dict
def serialize(cls, instance, fields=None): from nailgun.objects.release import Release release_dict = super(ReleaseSerializer, cls).serialize(instance, fields) release_dict["is_deployable"] = Release.is_deployable(instance) return release_dict
def serialize(cls, instance, fields=None): from nailgun.objects.release import Release release_dict = \ super(ReleaseSerializer, cls).serialize(instance, fields) release_dict["is_deployable"] = Release.is_deployable(instance) return release_dict
def serialize(cls, instance, fields=None): from nailgun.objects.release import Release release_dict = super(ReleaseSerializer, cls).serialize(instance, fields) release_dict["is_deployable"] = Release.is_deployable(instance) # TODO(ikalnitsky): Remove this list when new 'weight'-based # approach will be implemented. It'll be implemented soon, # so hardcoding is ok for now. release_dict["roles"] = ["controller", "compute", "cinder", "cinder-vmware", "ceph-osd", "mongo", "base-os"] return release_dict
def serialize(cls, instance, fields=None): from nailgun.objects.release import Release release_dict = \ super(ReleaseSerializer, cls).serialize(instance, fields) release_dict["is_deployable"] = Release.is_deployable(instance) if instance.orchestrator_data: release_dict["orchestrator_data"] = \ ReleaseOrchestratorDataSerializer.serialize( instance.orchestrator_data ) return release_dict
def serialize(cls, instance, fields=None): from nailgun.objects.release import Release release_dict = \ super(ReleaseSerializer, cls).serialize(instance, fields) release_dict["is_deployable"] = Release.is_deployable(instance) # TODO(ikalnitsky): Remove this list when new 'weight'-based # approach will be implemented. It'll be implemented soon, # so hardcoding is ok for now. release_dict['roles'] = [ 'controller', 'compute', 'cinder', 'cinder-vmware', 'ceph-osd', 'mongo', 'base-os', ] return release_dict
def execute(): """Function to prepare shell script to generate target image""" import sys import six from nailgun.settings import NailgunSettings from nailgun.objects.release import Release from nailgun import consts from nailgun.orchestrator import tasks_templates settings = NailgunSettings() master_ip = settings.config['MASTER_IP'] release_id = sys.argv[1] rel = Release.get_by_uid(release_id) packages_str = \ rel.attributes_metadata['editable']['provision']['packages']['value'] packages = list( six.moves.filter(bool, (s.strip() for s in packages_str.split('\n')))) task = tasks_templates.make_provisioning_images_task( [consts.MASTER_NODE_UID], rel.attributes_metadata['editable']['repo_setup']['repos']['value'], rel.attributes_metadata['generated']['provision'], 'prepare_release_ubuntu', packages) release_str = 'release_{release_id}'.format(release_id=release_id) with open('build_image.sh', 'w') as cmd_file: cmd_file.write(task['parameters']['cmd'].replace( "{cluster.release.environment_version}", rel.environment_version).replace( '{cluster.release.version}', rel.version).replace( '{settings.MASTER_IP}', master_ip).replace( "{cluster.id}", release_str))