Skip to content

Commit

Permalink
feat(disk_setup): Add support for nvme devices
Browse files Browse the repository at this point in the history
  • Loading branch information
holmanb committed May 5, 2024
1 parent b87e1e9 commit 4f77b7f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cloudinit/config/cc_disk_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import logging
import os
import shlex
from pathlib import Path
from textwrap import dedent

from cloudinit import subp, util
Expand Down Expand Up @@ -915,7 +916,12 @@ def mkfs(fs_cfg):
if not partition or partition.isdigit():
# Handle manual definition of partition
if partition.isdigit():
if device[-1].isdigit():
device = f"{device}p"
device = "%s%s" % (device, partition)
if not Path(device).is_block_device():
LOG.warning("Path %s does not exist or is not a block device")
return
LOG.debug(
"Manual request of partition %s for %s", partition, device
)
Expand Down

0 comments on commit 4f77b7f

Please sign in to comment.