Fix manual config devices
Set status is blocked when no block devices are found. Also skip manual config devices if not specified Change-Id: Ia2910dde612d11f7c697c27fd02789fe8b039488
This commit is contained in:
parent
aa4d62ace1
commit
cda014fec7
|
@ -652,9 +652,10 @@ def get_manual_bricks() -> Result:
|
||||||
log("Gathering list of manually specified brick devices")
|
log("Gathering list of manually specified brick devices")
|
||||||
brick_list = []
|
brick_list = []
|
||||||
manual_config_brick_devices = config("brick_devices")
|
manual_config_brick_devices = config("brick_devices")
|
||||||
for brick in manual_config_brick_devices.split(" "):
|
if manual_config_brick_devices:
|
||||||
if brick is not None:
|
for brick in manual_config_brick_devices.split(" "):
|
||||||
brick_list.append(brick)
|
if brick is not None:
|
||||||
|
brick_list.append(brick)
|
||||||
log("List of manual storage brick devices: {}".format(brick_list))
|
log("List of manual storage brick devices: {}".format(brick_list))
|
||||||
bricks = scan_devices(brick_list)
|
bricks = scan_devices(brick_list)
|
||||||
if bricks.is_err():
|
if bricks.is_err():
|
||||||
|
|
|
@ -223,6 +223,8 @@ def create_volume(peers: Dict[str, Dict],
|
||||||
log("Got brick list: {}".format(brick_list.value))
|
log("Got brick list: {}".format(brick_list.value))
|
||||||
log("Creating volume of type {} with brick list {}".format(
|
log("Creating volume of type {} with brick list {}".format(
|
||||||
cluster_type, [str(b) for b in brick_list.value]), INFO)
|
cluster_type, [str(b) for b in brick_list.value]), INFO)
|
||||||
|
if not brick_list.value:
|
||||||
|
return Err("No block devices detected")
|
||||||
|
|
||||||
result = None
|
result = None
|
||||||
if cluster_type is VolumeType.Distribute:
|
if cluster_type is VolumeType.Distribute:
|
||||||
|
@ -668,9 +670,16 @@ def update_status() -> None:
|
||||||
|
|
||||||
local_bricks = get_local_bricks(volume_name)
|
local_bricks = get_local_bricks(volume_name)
|
||||||
if local_bricks.is_ok():
|
if local_bricks.is_ok():
|
||||||
status_set(workload_state="active",
|
if local_bricks.value:
|
||||||
message="Unit is ready ({} bricks)".format(
|
status_set(workload_state="active",
|
||||||
len(local_bricks.value)))
|
message="Unit is ready ({} bricks)".format(
|
||||||
|
len(local_bricks.value)))
|
||||||
|
else:
|
||||||
|
status_set(
|
||||||
|
workload_state="blocked",
|
||||||
|
message='No block devices detected using '
|
||||||
|
'current configuration')
|
||||||
|
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
status_set(workload_state="blocked",
|
status_set(workload_state="blocked",
|
||||||
|
|
Loading…
Reference in New Issue