cloud-init-dev team mailing list archive
-
cloud-init-dev team
-
Mailing list archive
-
Message #05045
Re: [Merge] ~chad.smith/cloud-init:bug/1776701-openstack-local-no-probe-on-ec2 into cloud-init:master
trivial suggestions.
Diff comments:
> diff --git a/cloudinit/util.py b/cloudinit/util.py
> index 26a4112..40a3959 100644
> --- a/cloudinit/util.py
> +++ b/cloudinit/util.py
> @@ -2629,6 +2629,15 @@ def _call_dmidecode(key, dmidecode_path):
> return None
>
>
> +def is_x86():
can you make it take a parm? then get uname_arch if not passed in
def is_x86(uname_arch=None):
if uname_arch is None:
uname_arch = os.uname()[4]
...
then below the dmi code can pass in the os.uname_arch that it read.
> + """Return True if platform is x86-based"""
> + uname_arch = os.uname()[4]
> + x86_arch_match = (
> + uname_arch == 'x86_64' or
> + (uname_arch[0] == 'i' and uname_arch[2:] == '86'))
> + return x86_arch_match
> +
> +
> def read_dmi_data(key):
> """
> Wrapper for reading DMI data.
> diff --git a/doc/rtd/topics/datasources/openstack.rst b/doc/rtd/topics/datasources/openstack.rst
> index 0ea8994..2e8affc 100644
> --- a/doc/rtd/topics/datasources/openstack.rst
> +++ b/doc/rtd/topics/datasources/openstack.rst
> @@ -7,6 +7,21 @@ This datasource supports reading data from the
> `OpenStack Metadata Service
> <https://docs.openstack.org/nova/latest/admin/networking-nova.html#metadata-service>`_.
>
> +Discovery
> +-------------
> +To determine whether a platform looks like it may be OpenStack, cloud-init
> +checks the following environment attributes as a potential OpenStack platform:
> +
> + * Maybe OpenStack if
> +
> + * **non-x86 cpu architecture**: because DMI data is buggy on some arches
> + * Is OpenStack **if x86 architecture and ANY** of the following
> +
> + * **/proc/1/environ**: Contains *product_name=OpenStack Nova*
this is nova-lxd.
> + * **DMI product_name**: Either *Openstack Nova* or *OpenStack Compute*
> + * **DMI chassis_asset_tag** is *OpenTelekomCloud*
i dont knwo if we need to specify this... because if we ended up maintaining a list longer than this in code, why do it here also
> +
> +
> Configuration
> -------------
> The following configuration can be set for the datasource in system
--
https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/347937
Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:bug/1776701-openstack-local-no-probe-on-ec2 into cloud-init:master.
References