Skip to content

Commit

Permalink
Merge pull request red-hat-storage#3881 from psathyan/fixBlack
Browse files Browse the repository at this point in the history
Move to the latest version of black formatter
  • Loading branch information
mergify[bot] authored Jul 15, 2024
2 parents 639eb1f + b8cdf4d commit 2aec92d
Show file tree
Hide file tree
Showing 168 changed files with 220 additions and 73 deletions.
9 changes: 6 additions & 3 deletions ceph/ceph.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This module implements the required foundation data structures for testing."""

import datetime
import json
import pickle
Expand Down Expand Up @@ -299,9 +300,11 @@ def generate_ansible_inventory(
if "pool" in node.hostname:
logger.info(node.hostname)
devices = node.create_lvm(
devices[0:1]
if not device_to_add
else device_to_add.split(),
(
devices[0:1]
if not device_to_add
else device_to_add.split()
),
num=random.randint(1, 10) if device_to_add else None,
check_lvm=False if device_to_add else True,
)
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Over here, we create a glue between the CLI and CephCI to allow the QE to write test
scenarios for verifying and validating cephadm.
"""

from typing import Dict

from cli.utilities.configure import setup_ibm_licence
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/alert_manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Deploy the alert manager service in the cluster via cephadm CLI."""

from typing import Dict

from .apply import ApplyMixin
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
This is a mixin object and can be applied to the supported service classes.
"""

import re
from typing import Dict

Expand Down
7 changes: 4 additions & 3 deletions ceph/ceph_admin/bootstrap.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module that allows QE to interface with cephadm bootstrap CLI."""

import json
import tempfile
from distutils.version import LooseVersion
Expand Down Expand Up @@ -215,9 +216,9 @@ def bootstrap(self: CephAdmProtocol, config: Dict):
# an upgrade occurs. This enables us to execute the test in the right
# context.
self.config["base_url"] = _details[0]
self.config[
"container_image"
] = f"{_details[1]}/{_details[2]}:{_details[3]}"
self.config["container_image"] = (
f"{_details[1]}/{_details[2]}:{_details[3]}"
)
self.cluster.rhcs_version = _rhcs_version
rhbuild = f"{_rhcs_version}-{_platform}"
base_url = _details[0]
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/ceph.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Interface to the base command ceph."""

from ceph.ceph_admin import CephAdmin


Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/cephadm_ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- cephadm-purge-cluster.yaml
- cephadm-clients.yaml
"""

import re

from ceph.ceph_admin.common import config_dict_to_string
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/cephfs_mirror.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Manage the CephFS Mirror service via the cephadm CLI."""

from typing import Dict

from .apply import ApplyMixin
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains common functions that can used across the module."""

from typing import Dict


Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/crash.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Manage the Crash service via cephadm CLI."""

from typing import Dict

from .apply import ApplyMixin
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/daemon.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""CephADM orchestration Daemon operations."""

from utility.log import Log

from .add import AddMixin
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/dashboard.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Manage the Ceph Dashboard service via ceph CLI."""

import json
import tempfile
from json import loads
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/device.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""CephADM orchestration Device operations."""

from time import sleep
from typing import Dict, Optional, Tuple

Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/grafana.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Manage the Ceph Grafana service via cephadm CLI."""

from typing import Dict

from .apply import ApplyMixin
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/helper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Contains helper functions that can used across the module.
"""

import json
import os
import tempfile
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/host.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Cephadm orchestration host operations."""

import json
from copy import deepcopy

Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/iscsi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module to deploy and manage Ceph's iSCSI service."""

from typing import Dict

from ceph.utils import get_nodes_by_ids
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/ls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module that interfaces with ceph orch ls CLI."""

from typing import Dict, Optional, Tuple

from .common import config_dict_to_string
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/maintenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
This module is inherited where hosts are placed or exited from maintenance using orchestrator.
"""

from json import loads
from time import sleep
from typing import Dict
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Perform the manager operations via Ceph's cephadm CLI."""

from json import loads

from .ceph import CephCLI
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/mds.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Manage MDS service via Ceph's cephadm CLI."""

from typing import Dict

from .apply import ApplyMixin
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/mgr.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Manage the Manager service via Ceph's cephadm CLI."""

from typing import Dict

from .apply import ApplyMixin
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/mon.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Manage the Monitor service via cephadm CLI."""

from typing import Dict

from .apply import ApplyMixin
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/nfs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Manage the NFS service via the cephadm CLI."""

from typing import Dict

from .apply import ApplyMixin
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/node_exporter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module to deploy Node-Exporter service and individual daemon(s)."""

from typing import Dict

from .apply import ApplyMixin
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/nvmeof.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Manage the NVMeoF service via ceph-adm CLI."""

from typing import Dict

from .apply import ApplyMixin
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/orch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Provide the interfaces to ceph orch and in turn manage the orchestration engine.
"""

from datetime import datetime, timedelta
from json import loads
from time import sleep
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/osd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Manage OSD service via cephadm CLI."""

import json
from time import sleep
from typing import Dict
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/pause.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
This module is inherited where orchestrator operations are paused using pause command.
"""

from typing import Dict

from utility.log import Log
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/prometheus.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module to deploy Prometheus service and individual daemon(s)."""

from typing import Dict

from .apply import ApplyMixin
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/ps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module that interfaces with ceph orch ps CLI."""

from typing import Dict, Optional, Tuple

from .common import config_dict_to_string
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/rbd_mirror.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Manage the RBD Mirror service via the cephadm CLI."""

from typing import Dict

from .apply import ApplyMixin
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/registry_login.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Cephadm registry login CLI Command."""

from copy import deepcopy
from typing import Dict

Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"ceph orch remove service.name "
This module inherited where service deleted using "remove" operation.
"""

from typing import Dict

from .common import config_dict_to_string
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/resume.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
This module is inherited where orchestrator operations are resumed using resume command.
"""

from typing import Dict

from utility.log import Log
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/rgw.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module to deploy RGW service and individual daemon(s)."""

from typing import Dict

from .apply import ApplyMixin
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/shell.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Interface to cephadm shell CLI."""

from copy import deepcopy
from typing import Dict, List

Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/snmp_gateway.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module to deploy SNMP-Gateway service and individual daemon(s)."""

from typing import Dict

from .apply import ApplyMixin
Expand Down
38 changes: 14 additions & 24 deletions ceph/ceph_admin/typing_.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# flake8: noqa
"""Custom typing objects to avoid circular imports."""

from datetime import datetime
from typing import Dict, List

Expand All @@ -17,17 +19,13 @@ class CephAdmProtocol(Protocol):
config: Dict
installer: CephInstaller

def read_cephadm_gen_pub_key(self, ssh_key_path=None):
...
def read_cephadm_gen_pub_key(self, ssh_key_path=None): ...

def distribute_cephadm_gen_pub_key(self, ssh_key_path=None, nodes=None):
...
def distribute_cephadm_gen_pub_key(self, ssh_key_path=None, nodes=None): ...

def set_tool_repo(self, repo=None):
...
def set_tool_repo(self, repo=None): ...

def install(self, **kwargs: Dict) -> None:
...
def install(self, **kwargs: Dict) -> None: ...

def shell(
self,
Expand All @@ -36,8 +34,7 @@ def shell(
check_status: bool = True,
timeout: int = 600,
long_running: bool = False,
):
...
): ...


class OrchProtocol(CephAdmProtocol, Protocol):
Expand All @@ -52,36 +49,29 @@ def shell(
check_status: bool = True,
timeout: int = 600,
long_running: bool = False,
):
...
): ...

def get_role_service(self, service_name: str) -> str:
...
def get_role_service(self, service_name: str) -> str: ...

def get_hosts_by_label(self, label: str) -> List:
...
def get_hosts_by_label(self, label: str) -> List: ...

def check_service(
self,
service_name: str,
timeout: int = 300,
interval: int = 5,
exist: bool = True,
) -> bool:
...
) -> bool: ...

def op(self, op: str, config: Dict):
...
def op(self, op: str, config: Dict): ...

def verify_status(self, op: str) -> None:
...
def verify_status(self, op: str) -> None: ...

def check_service_restart(
self,
service_name: str,
restart_init_time: datetime,
) -> bool:
...
) -> bool: ...


class DaemonProtocol(OrchProtocol, Protocol):
Expand Down
1 change: 1 addition & 0 deletions ceph/ceph_admin/upgrade.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module that interfaces with ceph orch upgrade CLI."""

from datetime import datetime, timedelta
from json import loads
from time import sleep
Expand Down
1 change: 1 addition & 0 deletions ceph/nvmegw_cli/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Configure spdk and start spdk.
- Configure nvme-of targets using control.cli.
"""

from json import loads

from ceph.ceph_admin.common import config_dict_to_string
Expand Down
1 change: 1 addition & 0 deletions ceph/nvmeof/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Configure spdk and start spdk.
- Configure nvme-of targets using control.cli.
"""

import re

from ceph.ceph import CephNode
Expand Down
1 change: 1 addition & 0 deletions ceph/nvmeof/initiator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""NVME Initiator."""

from .nvme_cli import NVMeCLI


Expand Down
1 change: 1 addition & 0 deletions ceph/rados/crushtool_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
8. bin file tests. ( stats, bad mappings etc.)
9. dump and verify bin file contents
"""

import json
import re

Expand Down
Loading

0 comments on commit 2aec92d

Please sign in to comment.