Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identify Huawei Cloud as OpenStack #1689

Merged
merged 1 commit into from
Aug 31, 2022
Merged

Conversation

huang-xinjie
Copy link
Contributor

@huang-xinjie huang-xinjie commented Aug 25, 2022

Huawei Cloud is a international cloud provider and it runs OpenStack.
Due to the commit 1efa8a0, we're not able to force the use of the OpenStack datasource.
So we need to become an official provider.

Checklist:

  • My code follows the process laid out in the documentation
  • I have updated or added any unit tests accordingly
  • I have updated or added any documentation accordingly

Copy link

@archerslaw archerslaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good To Me.

Copy link

@archerslaw archerslaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good To Me.

Copy link
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank your for this submission @ixjhuang. I agree to the general approach here, and I also confirm the github username ixjhuang has signed cloud-init's ContributorLicenseAgreement.

In order to accept this PR can you please perform the following:

  1. Add trailing comma in the apport.py module
  2. Make sure tox -e do_format passes on this branch
  3. Add a comment to this PR with the output of the file /run/cloud-init/ds-identify.log for future reference of the detected platform information for Huawei

@@ -29,6 +29,7 @@
"DigitalOcean",
"E24Cloud",
"GCE - Google Compute Engine",
"Huawei Cloud"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a trailing comma here

Suggested change
"Huawei Cloud"
"Huawei Cloud",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, thanks for your review @blackboxsw .
The code has been modified and I would like to confirm the third comment. In the output of file /run/cloud-init/ds-identify.log already contains Huawei cloud information, do you mean to add some additional information?
image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ixjhuang this is perfect thank you. I wanted to see a point of reference for what ds-identify "sees" on Huawei platform in DMI_* values. to confirm other environmental factors available on the platform.

@blackboxsw blackboxsw self-assigned this Aug 29, 2022
@huang-xinjie huang-xinjie force-pushed the main branch 2 times, most recently from 458c4fc to 38091a9 Compare August 30, 2022 05:25
Copy link
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @ixjhuang.
Looks like tox -e do_format will suggest the following diff which wiould fail our CI
After this diff is applied I'll click the CI runner and this PR should be good to merge.
We may hold it a couple of days before merging because we are in the middle of a public release validation of version 22.3 and want to keep commits in tip of main stable for a couple of days to avoid release branch churn. Other than the formatting change. this looks good to me.

index c252eaae8..88e4f6c2e 100644
--- a/cloudinit/sources/DataSourceOpenStack.py
+++ b/cloudinit/sources/DataSourceOpenStack.py
@@ -32,9 +32,13 @@ DMI_ASSET_TAG_OPENTELEKOM = "OpenTelekomCloud"
 # See github.com/sapcc/helm-charts/blob/master/openstack/nova/values.yaml
 # -> compute.defaults.vmware.smbios_asset_tag for this value
 DMI_ASSET_TAG_SAPCCLOUD = "SAP CCloud VM"
-DMI_ASSET_TAG_HUAWEICLOUD = 'HUAWEICLOUD'
+DMI_ASSET_TAG_HUAWEICLOUD = "HUAWEICLOUD"
 VALID_DMI_ASSET_TAGS = VALID_DMI_PRODUCT_NAMES
-VALID_DMI_ASSET_TAGS += [DMI_ASSET_TAG_HUAWEICLOUD, DMI_ASSET_TAG_OPENTELEKOM, DMI_ASSET_TAG_SAPCCLOUD]
+VALID_DMI_ASSET_TAGS += [
+    DMI_ASSET_TAG_HUAWEICLOUD,
+    DMI_ASSET_TAG_OPENTELEKOM,
+    DMI_ASSET_TAG_SAPCCLOUD,
+]
 
 
 class DataSourceOpenStack(openstack.SourceMixin, sources.DataSource):

add Huawei Cloud as cloud provider
@huang-xinjie
Copy link
Contributor Author

huang-xinjie commented Aug 31, 2022

Thanks for your review and answers @blackboxsw .
After the code formatting, the execution results of tox -e do_format are as follows:
image

Copy link
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!. thanks for the discussion here

@blackboxsw blackboxsw merged commit 6460d2f into canonical:main Aug 31, 2022
holmanb pushed a commit to holmanb/cloud-init that referenced this pull request Aug 31, 2022
Huawei Cloud is a international cloud provider and it runs OpenStack.
Due to the commit 1efa8a0, we're not able to force the use of the
OpenStack datasource.

Detect OpenStack  when DMI chassis_asset_tag is HUAWEICLOUD
@blackboxsw blackboxsw mentioned this pull request Sep 1, 2022
aciba90 pushed a commit to aciba90/cloud-init that referenced this pull request Sep 26, 2022
Huawei Cloud is a international cloud provider and it runs OpenStack.
Due to the commit 1efa8a0, we're not able to force the use of the
OpenStack datasource.

Detect OpenStack  when DMI chassis_asset_tag is HUAWEICLOUD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants