]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #56928 from adk3798/grafana-anon-access-dropped
authorAdam King <47704447+adk3798@users.noreply.github.com>
Tue, 30 Apr 2024 19:36:27 +0000 (15:36 -0400)
committerGitHub <noreply@github.com>
Tue, 30 Apr 2024 19:36:27 +0000 (15:36 -0400)
python-common: handle "anonymous_access: false" in to_json of Grafana spec

Reviewed-by: Nizamudeen A <nia@redhat.com>
1  2 
src/python-common/ceph/deployment/service_spec.py

index 9d1212d4609b239c07fbf0aac1c343d795c80bbf,cfcc08188f9667f85805ecc2a0fcadcf6bedae75..5c43548bc48906b3c18d3c66c55295372e2fdfef
@@@ -1494,48 -1494,18 +1494,54 @@@ class NvmeofServiceSpec(ServiceSpec)
                  raise SpecValidationError(
                      'Invalid SPDK log level. Valid values are: DEBUG, INFO, WARNING, ERROR, NOTICE')
  
-         if self.spdk_ping_interval_in_seconds < 1.0:
+         if (
+             self.spdk_ping_interval_in_seconds
+             and self.spdk_ping_interval_in_seconds < 1.0
+         ):
              raise SpecValidationError("SPDK ping interval should be at least 1 second")
  
-         if self.allowed_consecutive_spdk_ping_failures < 1:
+         if (
+             self.allowed_consecutive_spdk_ping_failures
+             and self.allowed_consecutive_spdk_ping_failures < 1
+         ):
              raise SpecValidationError("Allowed consecutive SPDK ping failures should be at least 1")
  
 +        if self.state_update_interval_sec < 0:
 +            raise SpecValidationError("State update interval can't be negative")
 +
 +        if self.omap_file_lock_duration < 0:
 +            raise SpecValidationError("OMAP file lock duration can't be negative")
 +
 +        if self.omap_file_lock_retries < 0:
 +            raise SpecValidationError("OMAP file lock retries can't be negative")
 +
 +        if self.omap_file_update_reloads < 0:
 +            raise SpecValidationError("OMAP file reloads can't be negative")
 +
 +        if self.spdk_timeout < 0.0:
 +            raise SpecValidationError("SPDK timeout can't be negative")
 +
 +        if self.conn_retries < 0:
 +            raise SpecValidationError("Connection retries can't be negative")
 +
 +        if self.max_log_file_size_in_mb < 0:
 +            raise SpecValidationError("Log file size can't be negative")
 +
 +        if self.max_log_files_count < 0:
 +            raise SpecValidationError("Log files count can't be negative")
 +
 +        if self.max_log_directory_backups < 0:
 +            raise SpecValidationError("Log file directory backups can't be negative")
 +
 +        if self.monitor_timeout < 0.0:
 +            raise SpecValidationError("Monitor timeout can't be negative")
 +
 +        if self.port and self.port < 0:
 +            raise SpecValidationError("Port can't be negative")
 +
 +        if self.discovery_port and self.discovery_port < 0:
 +            raise SpecValidationError("Discovery port can't be negative")
 +
  
  yaml.add_representer(NvmeofServiceSpec, ServiceSpec.yaml_representer)