Last active
October 6, 2020 09:18
-
-
Save martinsotir/3436ff420cc787747a012a82497b3895 to your computer and use it in GitHub Desktop.
A quick way to check if the we are running within openstack from python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _is_host_openstack(): | |
product_name = Path("/sys/devices/virtual/dmi/id/product_name") | |
return product_name.exists() and "OpenStack" in product_name.read_text() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment