Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
matrix:
env: [ruff, mypy, pylint, black, isort]
name: Check ${{ matrix.env }}
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- name: "Checkout #1"
uses: actions/checkout@v4
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/shellcheck-debian-scripts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: ShellCheck Debian package scripts

env:
# This is a space separated string for multiple globs
# Do not use curly braces as they will be treated as literal string in `git ls-files ${GLOBS_TO_SHELLCHECK}`
# If you decide to use globstar, make sure to use the bash shell and to `shopt -s globstar`
# Assumption in this workflow: the resolved filepaths do not contain spaces.
GLOBS_TO_SHELLCHECK: "debian/cherry-pick debian/*.config debian/*.postinst debian/*.postrm debian/*.preinst debian/*.prerm packages/debian/*.postrm"

on:
pull_request:
# There is a known bug in Github but it will most probably not affect out use case
# https://github.com/orgs/community/discussions/118623#discussioncomment-9087833
# When there are 2 PRs using the same source branch (actually the same head SHA to be more specific), with the base branch in one PR matching
# on.pull_request.branches and thee base branch in the second PR not matching this key,
# then the second PR will show these checks that were triggered by the first PR but not the second PR.
branches:
- 'ubuntu/**'
- main

concurrency:
group: 'ci-${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true

# Note: No need to specify the shell option in the shellcheck command
# as shellcheck reads and uses the shebang at the top of the linted scripts.
jobs:
shellcheck-on-matching-and-changed-files:
name: ShellCheck on matching files that have changed
runs-on: ubuntu-24.04
steps:
- name: Repository checkout
uses: actions/checkout@v4

- name: Get all matching changed files
id: matching-changed-files
# For security, make sure to use a SHA not a version
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62
with:
files: ${{ env.GLOBS_TO_SHELLCHECK }}
files_separator: " "

- name: Run shellcheck on the matching changed files
env:
ALL_CHANGED_FILES: ${{ steps.matching-changed-files.outputs.all_changed_and_modified_files }}
run: |
if [ -z "${ALL_CHANGED_FILES}" ]
then
echo "There are no changed files in the repo which match the glob pattern \'${GLOBS_TO_SHELLCHECK}\' so shellcheck will not run"
else
RETAINED_CHANGED_FILES=$(git ls-files ${ALL_CHANGED_FILES} | tr '\n' ' ') #filter out deleted files
if [ -z "${RETAINED_CHANGED_FILES}" ]
then
echo "There are no changed files remaining in the repo which match the glob pattern \'${GLOBS_TO_SHELLCHECK}\' so shellcheck will not run"
else
echo "shellcheck will run on the remaining changed files: ${RETAINED_CHANGED_FILES}"
shellcheck ${RETAINED_CHANGED_FILES}
echo "shellcheck succeeded running on the remaining changed files"
fi
fi
4 changes: 2 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
stale-pr-message: |
Hello! Thank you for this proposed change to cloud-init. This pull request is now marked as stale as it has not seen any activity in 14 days. If no activity occurs within the next 7 days, this pull request will automatically close.

If you are waiting for code review and you are seeing this message, apologies! Please reply, tagging TheRealFalcon, and he will ensure that someone takes a look soon.
If you are waiting for code review and you are seeing this message, apologies! Please reply, tagging blackboxsw, and he will ensure that someone takes a look soon.

(If the pull request is closed and you would like to continue working on it, please do tag TheRealFalcon to reopen it.)
(If the pull request is closed and you would like to continue working on it, please do tag blackboxsw to reopen it.)
stale-pr-label: 'stale-pr'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.asc
*.build
*.buildinfo
*.builddir
*.changes
*.cover
*.deb
Expand Down
1 change: 1 addition & 0 deletions .pc/applied-patches
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ no-nocloud-network.patch
grub-dpkg-support.patch
no-remove-networkd-online.patch
strip-invalid-mtu.patch
retain-setuptools.patch
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,47 @@
},
"minProperties": 1
},
"rh_subscription_activation_key": {
"type": "string",
"description": "The activation key to use. Must be used with **org**. Should not be used with **username** or **password**."
},
"rh_subscription_auto_attach": {
"type": "boolean",
"description": "Whether to attach subscriptions automatically."
},
"rh_subscription_service_level": {
"type": "string",
"description": "The service level to use when subscribing to RH repositories. ``auto_attach`` must be true for this to be used."
},
"rh_subscription_add_pool": {
"type": "array",
"description": "A list of pool IDs add to the subscription.",
"items": {
"type": "string"
}
},
"rh_subscription_enable_repo": {
"type": "array",
"description": "A list of repositories to enable.",
"items": {
"type": "string"
}
},
"rh_subscription_disable_repo": {
"type": "array",
"description": "A list of repositories to disable.",
"items": {
"type": "string"
}
},
"rh_subscription_rhsm_baseurl": {
"type": "string",
"description": "Sets the baseurl in ``/etc/rhsm/rhsm.conf``."
},
"rh_subscription_server_hostname": {
"type": "string",
"description": "Sets the serverurl in ``/etc/rhsm/rhsm.conf``."
},
"modules_definition": {
"type": "array",
"items": {
Expand Down Expand Up @@ -2580,18 +2621,23 @@
"properties": {
"username": {
"type": "string",
"description": "The username to use. Must be used with password. Should not be used with **activation-key** or **org**."
"description": "The username to use. Must be used with password. Should not be used with **activation_key** or **org**."
},
"password": {
"type": "string",
"description": "The password to use. Must be used with username. Should not be used with **activation-key** or **org**."
"description": "The password to use. Must be used with username. Should not be used with **activation_key** or **org**."
},
"activation_key": {
"$ref": "#/$defs/rh_subscription_activation_key"
},
"activation-key": {
"type": "string",
"description": "The activation key to use. Must be used with **org**. Should not be used with **username** or **password**."
"$ref": "#/$defs/rh_subscription_activation_key",
"deprecated": true,
"deprecated_version": "25.3",
"deprecated_description": "Use **activation_key** instead."
},
"org": {
"description": "The organization to use. Must be used with **activation-key**. Should not be used with **username** or **password**.",
"description": "The organization to use. Must be used with **activation_key**. Should not be used with **username** or **password**.",
"oneOf": [
{
"type": "string"
Expand All @@ -2604,44 +2650,140 @@
}
]
},
"auto_attach": {
"$ref": "#/$defs/rh_subscription_auto_attach"
},
"auto-attach": {
"type": "boolean",
"description": "Whether to attach subscriptions automatically."
"$ref": "#/$defs/rh_subscription_auto_attach",
"deprecated": true,
"deprecated_version": "25.3",
"deprecated_description": "Use **auto_attach** instead."
},
"service_level": {
"$ref": "#/$defs/rh_subscription_service_level"
},
"service-level": {
"type": "string",
"description": "The service level to use when subscribing to RH repositories. ``auto-attach`` must be true for this to be used."
"$ref": "#/$defs/rh_subscription_service_level",
"deprecated": true,
"deprecated_version": "25.3",
"deprecated_description": "Use **service_level** instead."
},
"add_pool": {
"$ref": "#/$defs/rh_subscription_add_pool"
},
"add-pool": {
"type": "array",
"description": "A list of pools ids add to the subscription.",
"items": {
"type": "string"
}
"$ref": "#/$defs/rh_subscription_add_pool",
"deprecated": true,
"deprecated_version": "25.3",
"deprecated_description": "Use **add_pool** instead."
},
"enable_repo": {
"$ref": "#/$defs/rh_subscription_enable_repo"
},
"enable-repo": {
"type": "array",
"description": "A list of repositories to enable.",
"items": {
"type": "string"
}
"$ref": "#/$defs/rh_subscription_enable_repo",
"deprecated": true,
"deprecated_version": "25.3",
"deprecated_description": "Use **enable_repo** instead."
},
"disable_repo": {
"$ref": "#/$defs/rh_subscription_disable_repo"
},
"disable-repo": {
"type": "array",
"description": "A list of repositories to disable.",
"items": {
"type": "string"
}
"$ref": "#/$defs/rh_subscription_disable_repo",
"deprecated": true,
"deprecated_version": "25.3",
"deprecated_description": "Use **disable_repo** instead."
},
"rhsm-baseurl": {
"release_version": {
"type": "string",
"description": "Sets the baseurl in ``/etc/rhsm/rhsm.conf``."
"description": "Sets the release_version via``subscription-manager release --set=<release_version>`` then deletes the package manager cache ``/var/cache/{dnf,yum}`` . These steps are applied after any pool attachment and/or enabling/disabling repos. For more information about this key, check https://access.redhat.com/solutions/238533 ."
},
"rhsm_baseurl": {
"$ref": "#/$defs/rh_subscription_rhsm_baseurl"
},
"rhsm-baseurl": {
"$ref": "#/$defs/rh_subscription_rhsm_baseurl",
"deprecated": true,
"deprecated_version": "25.3",
"deprecated_description": "Use **rhsm_baseurl** instead."
},
"server_hostname": {
"$ref": "#/$defs/rh_subscription_server_hostname"
},
"server-hostname": {
"type": "string",
"description": "Sets the serverurl in ``/etc/rhsm/rhsm.conf``."
"$ref": "#/$defs/rh_subscription_server_hostname",
"deprecated": true,
"deprecated_version": "25.3",
"deprecated_description": "Use **server_hostname** instead."
}
}
},
"allOf": [
{
"not": {
"required": [
"activation_key",
"activation-key"
]
}
},
{
"not": {
"required": [
"auto_attach",
"auto-attach"
]
}
},
{
"not": {
"required": [
"service_level",
"service-level"
]
}
},
{
"not": {
"required": [
"add_pool",
"add-pool"
]
}
},
{
"not": {
"required": [
"enable_repo",
"enable-repo"
]
}
},
{
"not": {
"required": [
"disable_repo",
"disable-repo"
]
}
},
{
"not": {
"required": [
"rhsm_baseurl",
"rhsm-baseurl"
]
}
},
{
"not": {
"required": [
"server_hostname",
"server-hostname"
]
}
}
]
}
}
},
Expand Down Expand Up @@ -2692,11 +2834,6 @@
"type": "boolean",
"description": "Enable 1-Wire interface. Default: ``false``.",
"default": false
},
"remote_gpio": {
"type": "boolean",
"description": "Enable remote GPIO interface. Default: ``false``.",
"default": false
}
}
},
Expand Down Expand Up @@ -3328,7 +3465,7 @@
"properties": {
"manage_etc_hosts": {
"default": false,
"description": "Whether to manage ``/etc/hosts`` on the system. If ``true``, render the hosts file using ``/etc/cloud/templates/hosts.tmpl`` replacing ``$hostname`` and ``$fdqn``. If ``localhost``, append a ``127.0.1.1`` entry that resolves from FQDN and hostname every boot. Default: ``false``.",
"description": "Whether to manage ``/etc/hosts`` on the system. If ``true``, render the hosts file using ``/etc/cloud/templates/hosts.tmpl`` replacing ``$hostname`` and ``$fqdn``. If ``localhost``, append a ``127.0.1.1`` entry that resolves from FQDN and hostname every boot. Default: ``false``.",
"oneOf": [
{
"enum": [
Expand Down
12 changes: 11 additions & 1 deletion .pc/no-nocloud-network.patch/cloudinit/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,8 +914,18 @@ def center(text, fill, max_len):


def del_dir(path):
'''
Deletes a directory and all its contents by calling shutil.rmtree
Will ignore FileNotFoundError

@param path: The path of the directory.
"""
'''
LOG.debug("Recursively deleting %s", path)
shutil.rmtree(path)
try:
shutil.rmtree(path)
except FileNotFoundError:
pass


def read_optional_seed(fill, base="", ext="", timeout=5):
Expand Down
Loading
Loading