Beispiel #1
0
 def scylla_yaml(self) -> dict:
     scylla_yaml = ScyllaYaml(
     ) if self.scylla_yaml_raw is None else self.scylla_yaml_raw
     scylla_yaml.cluster_name = self.cluster_name
     if self.bootstrap is not None:
         scylla_yaml.auto_bootstrap = self.bootstrap
     return scylla_yaml.dict(exclude_defaults=True,
                             exclude_none=True,
                             exclude_unset=True)
 def scylla_machine_image_json(self) -> str:
     """Specifies configuration file accepted by scylla-machine-image service"""
     if (self.params.get("data_volume_disk_num") or 0) > 0:
         data_device = 'attached'
     else:
         data_device = 'instance_store'
     scylla_yaml = ScyllaYaml()
     scylla_yaml.cluster_name = f"{self.params.get('user_prefix') or DEFAULT_USER_PREFIX}-{self.test_config.test_id()[:8]}"
     smi_payload = {
         "start_scylla_on_first_boot":
         False,
         "data_device":
         data_device,
         "raid_level":
         self.params.get("raid_level") or 0,
         "scylla_yaml":
         scylla_yaml.dict(exclude_defaults=True,
                          exclude_none=True,
                          exclude_unset=True)
     }
     return json.dumps(smi_payload)