Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
Signed-off-by: Shreenidhi Shedi <shreenidhi.shedi@broadcom.com>
  • Loading branch information
sshedi committed May 26, 2024
1 parent 19cb8cf commit 8e1268b
Show file tree
Hide file tree
Showing 18 changed files with 2 additions and 37 deletions.
9 changes: 0 additions & 9 deletions cloudinit/analyze/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
"%T": "total_time",
}

formatting_help = " ".join(
["{0}: {1}".format(k.replace("%", "%%"), v) for k, v in format_key.items()]
)
SUCCESS_CODE = "successful"
FAIL_CODE = "failure"
CONTAINER_CODE = "container"
Expand Down Expand Up @@ -257,21 +254,15 @@ def gather_timestamps_using_systemd():

def generate_records(
events,
blame_sort=False,
print_format="(%n) %d seconds in %I%D",
dump_files=False,
log_datafiles=False,
):
"""
Take in raw events and create parent-child dependencies between events
in order to order events in chronological order.
:param events: JSONs from dump that represents events taken from logs
:param blame_sort: whether to sort by timestamp or by time taken.
:param print_format: formatting to represent event, time stamp,
and time taken by the event in one line
:param dump_files: whether to dump files into JSONs
:param log_datafiles: whether or not to log events generated
:return: boot records ordered chronologically
"""
Expand Down
4 changes: 0 additions & 4 deletions cloudinit/apport.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@
"Other",
]

# Potentially clear text collected logs
CLOUDINIT_LOG = "/var/log/cloud-init.log"
CLOUDINIT_OUTPUT_LOG = "/var/log/cloud-init-output.log"


def _get_user_data_file() -> str:
paths = read_cfg_paths()
Expand Down
2 changes: 0 additions & 2 deletions cloudinit/config/cc_chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
OMNIBUS_URL_RETRIES = 5

CHEF_VALIDATION_PEM_PATH = "/etc/chef/validation.pem"
CHEF_ENCRYPTED_DATA_BAG_PATH = "/etc/chef/encrypted_data_bag_secret"
CHEF_ENVIRONMENT = "_default"
CHEF_FB_PATH = "/etc/chef/firstboot.json"
CHEF_RB_TPL_DEFAULTS = {
# These are ruby symbols...
Expand Down
2 changes: 0 additions & 2 deletions cloudinit/config/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
{examples}
"""
SCHEMA_PROPERTY_HEADER = ""
SCHEMA_PROPERTY_TMPL = "{prefix}* **{prop_name}:** ({prop_type}){description}"
SCHEMA_LIST_ITEM_TMPL = (
"{prefix}* Each object in **{prop_name}** list supports "
Expand All @@ -110,7 +109,6 @@
SCHEMA_EXAMPLES_HEADER = ""
SCHEMA_EXAMPLES_SPACER_TEMPLATE = "\n # --- Example{example_count} ---\n\n"
DEPRECATED_KEY = "deprecated"
DEPRECATED_PREFIX = "DEPRECATED: "

# user-data files typically must begin with a leading '#'
USERDATA_VALID_HEADERS = sorted(
Expand Down
1 change: 0 additions & 1 deletion cloudinit/distros/debian.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
# network: {config: disabled}
"""

NETWORK_CONF_FN = "/etc/network/interfaces.d/50-cloud-init"
LOCALE_CONF_FN = "/etc/default/locale"


Expand Down
2 changes: 0 additions & 2 deletions cloudinit/distros/opensuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ class Distro(distros.Distro):
init_cmd = ["service"]
locale_conf_fn = "/etc/sysconfig/language"
network_conf_fn = "/etc/sysconfig/network/config"
network_script_tpl = "/etc/sysconfig/network/ifcfg-%s"
route_conf_tpl = "/etc/sysconfig/network/ifroute-%s"
systemd_hostname_conf_fn = "/etc/hostname"
systemd_locale_conf_fn = "/etc/locale.conf"
tz_local_fn = "/etc/localtime"
Expand Down
2 changes: 0 additions & 2 deletions cloudinit/distros/parsers/ifconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

LOG = logging.getLogger(__name__)

MAC_RE = r"""([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}"""


class Ifstate:
"""
Expand Down
1 change: 0 additions & 1 deletion cloudinit/distros/rhel.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class Distro(distros.Distro):
network_conf_fn = "/etc/sysconfig/network"
hostname_conf_fn = "/etc/sysconfig/network"
systemd_hostname_conf_fn = "/etc/hostname"
network_script_tpl = "/etc/sysconfig/network-scripts/ifcfg-%s"
tz_local_fn = "/etc/localtime"
usr_lib_exec = "/usr/libexec"
# RHEL and derivatives use NetworkManager DHCP client by default.
Expand Down
1 change: 0 additions & 1 deletion cloudinit/dmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
DMI_SYS_PATH = "/sys/class/dmi/id"

KernelNames = namedtuple("KernelNames", ["linux", "freebsd", "openbsd"])
KernelNames.__new__.__defaults__ = (None, None, None)

# FreeBSD's kenv(1) and Linux /sys/class/dmi/id/* both use different names from
# dmidecode. The values are the same, and ultimately what we're interested in.
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/net/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ def _rename_interfaces(

LOG.debug("Detected interfaces %s", cur_info)

def update_byname(bymac):
def update_byname(cur_info):
return dict((data["name"], data) for data in cur_info.values())

ops = []
Expand Down
1 change: 0 additions & 1 deletion cloudinit/sources/DataSourceAzure.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ def get_resource_disk_on_freebsd(port_id) -> Optional[str]:

DS_CFG_PATH = ["datasource", DS_NAME]
DS_CFG_KEY_PRESERVE_NTFS = "never_destroy_ntfs"
DEF_EPHEMERAL_LABEL = "Temporary Storage"

# The redacted password fails to meet password complexity requirements
# so we can safely use this to mask/redact the password in the ovf-env.xml
Expand Down
1 change: 0 additions & 1 deletion cloudinit/sources/DataSourceConfigDrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

# Various defaults/constants...
DEFAULT_IID = "iid-dsconfigdrive"
DEFAULT_MODE = "pass"
DEFAULT_METADATA = {
"instance-id": DEFAULT_IID,
}
Expand Down
2 changes: 0 additions & 2 deletions cloudinit/sources/DataSourceEc2.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@

LOG = logging.getLogger(__name__)

SKIP_METADATA_URL_CODES = frozenset([uhelp.NOT_FOUND])

STRICT_ID_PATH = ("datasource", "Ec2", "strict_id")
STRICT_ID_DEFAULT = "warn"

Expand Down
1 change: 0 additions & 1 deletion cloudinit/sources/DataSourceGCE.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

MD_V1_URL = "http://metadata.google.internal/computeMetadata/v1/"
BUILTIN_DS_CONFIG = {"metadata_url": MD_V1_URL}
REQUIRED_FIELDS = ("instance-id", "availability-zone", "local-hostname")
GUEST_ATTRIBUTES_URL = (
"http://metadata.google.internal/computeMetadata/"
"v1/instance/guest-attributes"
Expand Down
1 change: 0 additions & 1 deletion cloudinit/sources/DataSourceIBMCloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@

class Platforms:
TEMPLATE_LIVE_METADATA = "Template/Live/Metadata"
TEMPLATE_LIVE_NODATA = "UNABLE TO BE IDENTIFIED."
TEMPLATE_PROVISIONING_METADATA = "Template/Provisioning/Metadata"
TEMPLATE_PROVISIONING_NODATA = "Template/Provisioning/No-Metadata"
OS_CODE = "OS-Code/Live"
Expand Down
4 changes: 0 additions & 4 deletions cloudinit/sources/helpers/netlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,11 @@

# http://man7.org/linux/man-pages/man7/netlink.7.html
RTMGRP_LINK = 1
NLMSG_NOOP = 1
NLMSG_ERROR = 2
NLMSG_DONE = 3
RTM_NEWLINK = 16
RTM_DELLINK = 17
RTM_GETLINK = 18
RTM_SETLINK = 19
MAX_SIZE = 65535
RTA_DATA_OFFSET = 32
MSG_TYPE_OFFSET = 16
SELECT_TIMEOUT = 60

Expand Down
1 change: 0 additions & 1 deletion cloudinit/sources/helpers/vmware/imc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class Config:
RESETPASS = "PASSWORD|RESET"
SUFFIX = "DNS|SUFFIX|"
TIMEZONE = "DATETIME|TIMEZONE"
UTC = "DATETIME|UTC"
POST_GC_STATUS = "MISC|POST-GC-STATUS"
DEFAULT_RUN_POST_SCRIPT = "MISC|DEFAULT-RUN-POST-CUST-SCRIPT"
CLOUDINIT_META_DATA = "CLOUDINIT|METADATA"
Expand Down
2 changes: 1 addition & 1 deletion cloudinit/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ def load_yaml(blob, default=None, allowed=(dict,)):
return loaded


def read_seeded(base="", ext="", timeout=5, retries=10, file_retries=0):
def read_seeded(base="", ext="", timeout=5, retries=10):
if base.find("%s") >= 0:
ud_url = base.replace("%s", "user-data" + ext)
vd_url = base.replace("%s", "vendor-data" + ext)
Expand Down

0 comments on commit 8e1268b

Please sign in to comment.