← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] lp:~daniel-thewatkins/cloud-init/lp1411582 into lp:cloud-init

 

mostly fine.
how does the udev rule get installed? i guess i'd like packaging in trunk updated too.
 

Diff comments:

> 
> === modified file 'cloudinit/sources/DataSourceAzure.py'
> --- cloudinit/sources/DataSourceAzure.py	2015-05-22 16:28:17 +0000
> +++ cloudinit/sources/DataSourceAzure.py	2015-07-15 12:00:55 +0000
> @@ -276,30 +276,33 @@
>      return len(fnmatch.filter(os.listdir(mp), '*[!cdrom]*'))
>  
>  
> -def find_ephemeral_part():
> -    """
> -    Locate the default ephmeral0.1 device. This will be the first device
> -    that has a LABEL of DEF_EPHEMERAL_LABEL and is a NTFS device. If Azure
> -    gets more ephemeral devices, this logic will only identify the first
> -    such device.
> -    """
> -    c_label_devs = util.find_devs_with("LABEL=%s" % DEF_EPHEMERAL_LABEL)
> -    c_fstype_devs = util.find_devs_with("TYPE=ntfs")
> -    for dev in c_label_devs:
> -        if dev in c_fstype_devs:
> -            return dev
> +def find_fabric_formatted_ephemeral_part():
> +    """
> +    Locate the first fabric formatted ephemeral device.
> +    """
> +    potential_locations = ['/dev/disk/cloud/azure_resource-part1',

please put a comment here on why we're considering this azure/resource-part1 path. its not obvious why or how this would exist.

> +                           '/dev/disk/azure/resource-part1']
> +    device_location = None
> +    for potential_location in potential_locations:
> +        if os.path.exists(potential_location):
> +            device_location = potential_location
> +            break
> +    if device_location is None:
> +        return None
> +    ntfs_devices = util.find_devs_with("TYPE=ntfs")
> +    real_device = os.path.realpath(device_location)
> +    if real_device in ntfs_devices:
> +        return device_location
>      return None
>  
>  
> -def find_ephemeral_disk():
> +def find_fabric_formatted_ephemeral_disk():
>      """
>      Get the ephemeral disk.
>      """
> -    part_dev = find_ephemeral_part()
> -    if part_dev and str(part_dev[-1]).isdigit():
> -        return part_dev[:-1]
> -    elif part_dev:
> -        return part_dev
> +    part_dev = find_fabric_formatted_ephemeral_part()
> +    if part_dev:
> +        return part_dev.split('-')[0]
>      return None
>  
>  


-- 
https://code.launchpad.net/~daniel-thewatkins/cloud-init/lp1411582/+merge/264831
Your team cloud init development team is requested to review the proposed merge of lp:~daniel-thewatkins/cloud-init/lp1411582 into lp:cloud-init.


References