/
snap
/
core18
/
2979
/
usr
/
lib
/
python3
/
dist-packages
/
cloudinit
/
sources
/
/snap/core18/2979/usr/lib/python3/dist-packages/cloudinit/sources
mkdir
upload
Name
Size
Mode
Actions
azure/
-
0755
rm
helpers/
-
0755
rm
__pycache__/
-
0755
rm
DataSourceAliYun.py
2221
0644
edit
dl
rm
DataSourceAltCloud.py
8489
0644
edit
dl
rm
DataSourceAzure.py
70329
0644
edit
dl
rm
DataSourceBigstep.py
1964
0644
edit
dl
rm
DataSourceCloudSigma.py
4096
0644
edit
dl
rm
DataSourceCloudStack.py
10090
0644
edit
dl
rm
DataSourceConfigDrive.py
11275
0644
edit
dl
rm
DataSourceDigitalOcean.py
3904
0644
edit
dl
rm
DataSourceEc2.py
36670
0644
edit
dl
rm
DataSourceExoscale.py
9105
0644
edit
dl
rm
DataSourceGCE.py
12251
0644
edit
dl
rm
DataSourceHetzner.py
5537
0644
edit
dl
rm
DataSourceIBMCloud.py
14391
0644
edit
dl
rm
DataSourceLXD.py
17599
0644
edit
dl
rm
DataSourceMAAS.py
14735
0644
edit
dl
rm
DataSourceNoCloud.py
12676
0644
edit
dl
rm
DataSourceNone.py
1393
0644
edit
dl
rm
DataSourceNWCS.py
4768
0644
edit
dl
rm
DataSourceOpenNebula.py
16362
0644
edit
dl
rm
DataSourceOpenStack.py
10713
0644
edit
dl
rm
DataSourceOracle.py
15069
0644
edit
dl
rm
DataSourceOVF.py
10724
0644
edit
dl
rm
DataSourceRbxCloud.py
8021
0644
edit
dl
rm
DataSourceScaleway.py
9693
0644
edit
dl
rm
DataSourceSmartOS.py
34909
0644
edit
dl
rm
DataSourceUpCloud.py
5686
0644
edit
dl
rm
DataSourceVMware.py
33485
0644
edit
dl
rm
DataSourceVultr.py
4279
0644
edit
dl
rm
__init__.py
41771
0644
edit
dl
rm
Edit:
/snap/core18/2979/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceBigstep.py
(1964B)
# Copyright (C) 2015-2016 Bigstep Cloud Ltd. # # Author: Alexandru Sirbu <alexandru.sirbu@bigstep.com> # # This file is part of cloud-init. See LICENSE file for license information. import errno import json import os from cloudinit import sources, url_helper, util class DataSourceBigstep(sources.DataSource): dsname = "Bigstep" def __init__(self, sys_cfg, distro, paths): super().__init__(sys_cfg, distro, paths) self.metadata = {} self.vendordata_raw = "" self.userdata_raw = "" def _get_data(self, apply_filter=False) -> bool: url = self._get_url_from_file() if url is None: return False response = url_helper.readurl(url) decoded = json.loads(response.contents.decode()) self.metadata = decoded["metadata"] self.vendordata_raw = decoded["vendordata_raw"] self.userdata_raw = decoded["userdata_raw"] return True def _get_subplatform(self) -> str: """Return the subplatform metadata source details.""" return f"metadata ({self._get_url_from_file()})" def _get_url_from_file(self): url_file = os.path.join( self.paths.cloud_dir, "data", "seed", "bigstep", "url" ) try: content = util.load_file(url_file) except IOError as e: # If the file doesn't exist, then the server probably isn't a # Bigstep instance; otherwise, another problem exists which needs # investigation if e.errno == errno.ENOENT: return None else: raise return content # Used to match classes to dependencies datasources = [ (DataSourceBigstep, (sources.DEP_FILESYSTEM, sources.DEP_NETWORK)), ] # Return a list of data sources that match this set of dependencies def get_datasource_list(depends): return sources.list_from_depends(depends, datasources) # vi: ts=4 expandtab
Save
cmd:
run