Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cloudbaseinit/conf/nocloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ def __init__(self, config):
"userdata_file", default="user-data",
help="The file name where the service looks for"
"userdata"),
cfg.StrOpt(
"drive_label", default="cidata",
help="The path the service looks for metadata"),
]

def register(self):
Expand Down
2 changes: 2 additions & 0 deletions cloudbaseinit/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
CD_TYPES = {
"vfat", # Visible device (with partition table).
"iso", # "Raw" format containing ISO bytes.
"local", # Cloud-drive is just a local folder
}
CD_LOCATIONS = {
# Look into optical devices. Only an ISO format could be
Expand All @@ -27,6 +28,7 @@
# Search through partitions for raw ISO content or through volumes
# containing configuration drive's content.
"partition",
"local", # Cloud-drive is just a local folder
}

POLICY_IGNORE_ALL_FAILURES = "ignoreallfailures"
Expand Down
2 changes: 1 addition & 1 deletion cloudbaseinit/metadata/services/nocloudservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ class NoCloudConfigDriveService(baseconfigdrive.BaseConfigDriveService):

def __init__(self):
super(NoCloudConfigDriveService, self).__init__(
'cidata', CONF.nocloud.metadata_file,
CONF.nocloud.drive_label, CONF.nocloud.metadata_file,
CONF.nocloud.userdata_file)
self._meta_data = {}

Expand Down
7 changes: 7 additions & 0 deletions cloudbaseinit/metadata/services/osconfigdrive/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ def _get_config_drive_from_partition(self, drive_label, metadata_file):
return True
return False

def _get_config_drive_from_local(self, drive_label, metadata_file):
os.rmdir(self.target_path)
shutil.copytree(drive_label, self.target_path)
return True


def _get_config_drive_from_volume(self, drive_label, metadata_file):
"""Look through all the volumes for config drive."""
volumes = self._osutils.get_volumes()
Expand Down Expand Up @@ -231,6 +237,7 @@ def get_config_drive_files(self, drive_label, metadata_file,
@property
def config_drive_type_location(self):
return {
"local_local": self._get_config_drive_from_local,
"cdrom_iso": self._get_config_drive_from_cdrom_drive,
"hdd_iso": self._get_config_drive_from_raw_hdd,
"hdd_vfat": self._get_config_drive_from_vfat,
Expand Down