Commit 3c03759a authored by Iustin Pop's avatar Iustin Pop
Browse files

Move a hardcoded constant to constants.py

For now we only use the ‘C’ protocol so we can put it in constants.py
instead of hardcoding it.

Reviewed-by: imsnah
parent 2899d9de
......@@ -1253,7 +1253,8 @@ class DRBD8(BaseDRBD):
res_r = self._AssembleNet(minor,
(self._lhost, self._lport,
self._rhost, self._rport),
"C", hmac=constants.DRBD_HMAC_ALG,
constants.DRBD_NET_PROTOCOL,
hmac=constants.DRBD_HMAC_ALG,
secret=self._secret
)
if res_r:
......@@ -1283,7 +1284,8 @@ class DRBD8(BaseDRBD):
# local storage (i.e. one or more of the _[lr](host|port) is
# None)
if (self._AssembleNet(minor, (self._lhost, self._lport,
self._rhost, self._rport), "C",
self._rhost, self._rport),
constants.DRBD_NET_PROTOCOL,
hmac=constants.DRBD_HMAC_ALG,
secret=self._secret) and
self._MatchesNet(self._GetDevInfo(self._GetShowData(minor)))):
......@@ -1337,7 +1339,8 @@ class DRBD8(BaseDRBD):
result = self._AssembleNet(minor,
(self._lhost, self._lport,
self._rhost, self._rport),
"C", hmac=constants.DRBD_HMAC_ALG,
constants.DRBD_NET_PROTOCOL,
hmac=constants.DRBD_HMAC_ALG,
secret=self._secret)
if not result:
if need_localdev_teardown:
......
......@@ -178,6 +178,7 @@ LD_FILE = "file"
# drbd constants
DRBD_HMAC_ALG = "md5"
DRBD_NET_PROTOCOL = "C"
# file backend driver
FD_LOOP = "loop"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment