MCPcopy Create free account
hub / github.com/ceph/ceph / __init__

Method __init__

src/python-common/ceph/deployment/hostspec.py:53–78  ·  view source on GitHub ↗
(self,
                 hostname: str,
                 addr: Optional[str] = None,
                 labels: Optional[List[str]] = None,
                 status: Optional[str] = None,
                 location: Optional[Dict[str, str]] = None,
                 oob: Optional[Dict[str, str]] = None,
                 )

Source from the content-addressed store, hash-verified

51 Information about hosts. Like e.g. ``kubectl get nodes``
52 """
53 def __init__(self,
54 hostname: str,
55 addr: Optional[str] = None,
56 labels: Optional[List[str]] = None,
57 status: Optional[str] = None,
58 location: Optional[Dict[str, str]] = None,
59 oob: Optional[Dict[str, str]] = None,
60 ):
61 self.service_type = 'host'
62
63 #: the bare hostname on the host. Not the FQDN.
64 self.hostname = normalize_hostname(hostname)
65
66 #: DNS name or IP address to reach it
67 self.addr = addr or normalize_hostname(hostname)
68
69 #: label(s), if any
70 self.labels = labels or []
71
72 #: human readable status
73 self.status = status or ''
74
75 self.location = location
76
77 #: oob details, if provided
78 self.oob = oob
79
80 def validate(self) -> None:
81 assert_valid_host(self.hostname)

Callers 1

__init__Method · 0.45

Calls 1

normalize_hostnameFunction · 0.85

Tested by

no test coverage detected