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

Remove dead functionality from the codebase #3174

Merged
merged 2 commits into from
Jun 18, 2024
Merged
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
16 changes: 2 additions & 14 deletions lib/timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,13 @@
timer_jobs_state_file,
)
from uaclient.timer.metering import metering_enabled_resources
from uaclient.timer.update_contract_info import (
update_contract_info,
validate_release_series,
)
from uaclient.timer.update_contract_info import validate_release_series
from uaclient.timer.update_messaging import update_motd_messages

LOG = logging.getLogger("ubuntupro.timer")
UPDATE_MESSAGING_INTERVAL = 21600 # 6 hours
METERING_INTERVAL = 14400 # 4 hours
CHECK_RELEASE_SERIES_INTERVAL = 86400 # 24 hours
UPDATE_CONTRACT_INFO_INTERVAL = 86400 # 24 hours


class TimedJob:
Expand Down Expand Up @@ -119,11 +115,6 @@ def run_interval_seconds(self, cfg: UAConfig) -> int:
update_motd_messages,
UPDATE_MESSAGING_INTERVAL,
)
update_contract_info_job = TimedJob(
"update_contract_info",
update_contract_info,
UPDATE_CONTRACT_INFO_INTERVAL,
)
validate_release_series_job = TimedJob(
"validate_release_series",
validate_release_series,
Expand Down Expand Up @@ -177,10 +168,7 @@ def run_jobs(cfg: UAConfig, current_time: datetime):
# We do this for the first run of the timer job, where the file
# doesn't exist
jobs_status_obj = AllTimerJobsState(
metering=None,
update_messaging=None,
update_contract_info=None,
validate_release_series=None,
metering=None, update_messaging=None, validate_release_series=None
)

jobs_status_obj.metering = run_job(
Expand Down
3 changes: 0 additions & 3 deletions tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ in this directory will be shipped as part of the packaging
- check-versions-are-consistent.py: Helper script to verify changelog and package version matches.
- README.md: This file.
- refresh-keyrings.sh: Refresh the keyring files for services, stored in the repo
- run-integration-tests.py: Python entrypoint for the `tox -e behave` commands.
- setup_sbuild.sh: Downloads and prepares chroots used in the build (and test) process.
- test-in-lxd.sh: Build the package and then install it on an LXD instance for testing
- test-in-multipass.sh: Build the package and then install it on a multipass instance for testing
- ua.bash: Bash completion script for `ua` | `pro`
- ua-test-credentials.example.yaml: Template for inserting your own test
credentials - make a copy and/or remove `'.example'` to use it in `run-integration-tests.py`
229 changes: 0 additions & 229 deletions tools/run-integration-tests.py

This file was deleted.

6 changes: 0 additions & 6 deletions tools/ua-test-credentials.example.yaml

This file was deleted.

4 changes: 1 addition & 3 deletions uaclient/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@
CanDisableFailure,
CanEnableFailure,
)
from uaclient.files import machine_token, notices, state_files
from uaclient.files.notices import Notice
from uaclient.files import machine_token, state_files
from uaclient.log import get_user_or_root_log_file_path
from uaclient.timer.update_messaging import refresh_motd, update_motd_messages
from uaclient.yaml import safe_dump, safe_load
Expand Down Expand Up @@ -1187,7 +1186,6 @@ def action_refresh(args, *, cfg: config.UAConfig, **kwargs):

if args.target is None or args.target == "contract":
_action_refresh_contract(args, cfg)
notices.remove(Notice.CONTRACT_REFRESH_WARNING)

if args.target is None or args.target == "messages":
_action_refresh_messages(args, cfg)
Expand Down
2 changes: 0 additions & 2 deletions uaclient/cli/tests/test_cli_refresh.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ def test_refresh_contract_happy_path(
assert messages.REFRESH_CONTRACT_SUCCESS in capsys.readouterr()[0]
assert [mock.call(cfg)] == refresh.call_args_list
assert [
mock.call(Notice.CONTRACT_REFRESH_WARNING),
mock.call(Notice.OPERATION_IN_PROGRESS),
] == m_remove_notice.call_args_list

Expand Down Expand Up @@ -313,7 +312,6 @@ def test_refresh_all_happy_path(
assert [mock.call()] == m_process_config.call_args_list
assert [mock.call(cfg)] == m_refresh.call_args_list
assert [
mock.call(Notice.CONTRACT_REFRESH_WARNING),
mock.call(Notice.OPERATION_IN_PROGRESS),
] == m_remove_notice.call_args_list
assert 1 == m_update_motd.call_count
Expand Down
Loading
Loading