From 48ee1cf959c6cd920bb63a82b95c3ac359d24aa0 Mon Sep 17 00:00:00 2001 From: erjac77 Date: Tue, 9 Feb 2021 14:19:40 -0500 Subject: [PATCH] Changed tasks naming --- .nornir.meta | 18 +++++----- README.md | 34 +++++++++--------- nornir_f5/plugins/tasks/__init__.py | 36 +++++++++---------- nornir_f5/plugins/tasks/atc.py | 4 +-- .../plugins/tasks/bigip/cm/config_sync.py | 8 ++--- .../plugins/tasks/bigip/cm/failover_status.py | 2 +- .../plugins/tasks/bigip/cm/sync_status.py | 2 +- .../bigip/shared/file_transfer/uploads.py | 4 +-- .../shared/iapp/package_management_tasks.py | 18 +++++----- nornir_f5/plugins/tasks/bigip/sys/version.py | 2 +- nornir_f5/plugins/tasks/bigip/util/unix_ls.py | 2 +- nornir_f5/plugins/tasks/bigip/util/unix_rm.py | 2 +- poetry.lock | 6 ++-- tests/test_atc_tasks.py | 6 ++-- tests/test_bigip_cm_tasks.py | 12 +++---- tests/test_bigip_shared_tasks.py | 8 ++--- tests/test_bigip_sys_tasks.py | 4 +-- tests/test_bigip_util_tasks.py | 6 ++-- tests/test_readme.py | 12 +++---- 19 files changed, 93 insertions(+), 93 deletions(-) diff --git a/.nornir.meta b/.nornir.meta index 8f2cafe..595aaa2 100644 --- a/.nornir.meta +++ b/.nornir.meta @@ -13,12 +13,12 @@ intro_file: README.md connection_plugins: - nornir_f5.plugins.connections.F5RestClient task_plugins: - - nornir_f5.plugins.tasks.f5_atc - - nornir_f5.plugins.tasks.f5_bigip_cm_failover_status - - nornir_f5.plugins.tasks.f5_bigip_cm_sync_config - - nornir_f5.plugins.tasks.f5_bigip_cm_sync_status - - nornir_f5.plugins.tasks.f5_bigip_shared_file_transfer_uploads - - nornir_f5.plugins.tasks.f5_bigip_shared_iapp_lx_package - - nornir_f5.plugins.tasks.f5_bigip_sys_version - - nornir_f5.plugins.tasks.f5_bigip_util_unix_ls - - nornir_f5.plugins.tasks.f5_bigip_util_unix_rm + - nornir_f5.plugins.tasks.atc + - nornir_f5.plugins.tasks.bigip_cm_failover_status + - nornir_f5.plugins.tasks.bigip_cm_sync_config + - nornir_f5.plugins.tasks.bigip_cm_sync_status + - nornir_f5.plugins.tasks.bigip_shared_file_transfer_uploads + - nornir_f5.plugins.tasks.bigip_shared_iapp_lx_package + - nornir_f5.plugins.tasks.bigip_sys_version + - nornir_f5.plugins.tasks.bigip_util_unix_ls + - nornir_f5.plugins.tasks.bigip_util_unix_rm diff --git a/README.md b/README.md index 7fcde85..4c8d98f 100644 --- a/README.md +++ b/README.md @@ -31,22 +31,22 @@ from nornir.core.task import Result, Task from nornir_utils.plugins.functions import print_result from nornir_f5.plugins.tasks import ( - f5_atc, - f5_bigip_cm_config_sync, - f5_bigip_cm_failover_status, + atc, + bigip_cm_config_sync, + bigip_cm_failover_status, ) def as3_post(task: Task, as3_tenant: str) -> Result: # Get the failover status of the device. failover_status = task.run( - name="Get failover status", task=f5_bigip_cm_failover_status + name="Get failover status", task=bigip_cm_failover_status ).result # If it's the ACTIVE device, send the declaration and perform a sync. if failover_status == "ACTIVE": task.run( name="AS3 POST", - task=f5_atc, + task=atc, atc_method="POST", atc_service="AS3", as3_tenant=as3_tenant, @@ -57,7 +57,7 @@ def as3_post(task: Task, as3_tenant: str) -> Result: task.run( name="Synchronize the devices", - task=f5_bigip_cm_config_sync, + task=bigip_cm_config_sync, device_group=task.host["device_group"], ) @@ -85,24 +85,24 @@ print_result(result) ### Connections -* __f5__: Connect to F5 BIG-IP systems using REST APIs. +* __f5__: Connects to an F5 REST server. ### Tasks -* __f5_atc__: Deploy an F5 Automation Toolchain (ATC) declaration (AS3, DO and TS*) on a BIG-IP system. -* __f5_bigip_cm_config_sync__: Synchronize the configuration between BIG-IP systems. -* __f5_bigip_cm_failover_status__: Get the failover status of the BIG-IP system. -* __f5_bigip_cm_sync_status__: Get the configuration synchronization status of the BIG-IP system. -* __f5_bigip_shared_file_transfer_uploads__: Upload a file to a BIG-IP system. -* __f5_bigip_shared_iapp_lx_package__: Manage Javascript LX packages on a BIG-IP system. -* __f5_bigip_sys_version__: Get software version information for the BIG-IP system. -* __f5_bigip_util_unix_ls__: List information about the FILEs or directory content on a BIG-IP system. -* __f5_bigip_util_unix_rm__: Delete a file on a BIG-IP system. +* __atc__: Sends F5 Automation Toolchain (ATC) declaratives (like AS3, DO and TS) on a BIG-IP/BIG-IQ system. +* __bigip_cm_config_sync__: Synchronizes the configuration between BIG-IP systems. +* __bigip_cm_failover_status__: Gets the failover status of the BIG-IP system. +* __bigip_cm_sync_status__: Gets the configuration synchronization status of the BIG-IP system. +* __bigip_shared_file_transfer_uploads__: Uploads a file to a BIG-IP system. +* __bigip_shared_iapp_lx_package__: Manages Javascript LX packages on a BIG-IP system. +* __bigip_sys_version__: Gets software version information for the BIG-IP system. +* __bigip_util_unix_ls__: Lists information about the FILEs or directory content on a BIG-IP system. +* __bigip_util_unix_rm__: Deletes a file on a BIG-IP system. ## Roadmap * ATC: - * *Support Telemetry (TS) + * Support Telemetry (TS) * Support BIG-IQ * Support dry-run mode diff --git a/nornir_f5/plugins/tasks/__init__.py b/nornir_f5/plugins/tasks/__init__.py index d951dff..a152976 100644 --- a/nornir_f5/plugins/tasks/__init__.py +++ b/nornir_f5/plugins/tasks/__init__.py @@ -1,27 +1,27 @@ """Nornir F5 tasks.""" -from nornir_f5.plugins.tasks.atc import f5_atc -from nornir_f5.plugins.tasks.bigip.cm.config_sync import f5_bigip_cm_config_sync -from nornir_f5.plugins.tasks.bigip.cm.failover_status import f5_bigip_cm_failover_status -from nornir_f5.plugins.tasks.bigip.cm.sync_status import f5_bigip_cm_sync_status +from nornir_f5.plugins.tasks.atc import atc +from nornir_f5.plugins.tasks.bigip.cm.config_sync import bigip_cm_config_sync +from nornir_f5.plugins.tasks.bigip.cm.failover_status import bigip_cm_failover_status +from nornir_f5.plugins.tasks.bigip.cm.sync_status import bigip_cm_sync_status from nornir_f5.plugins.tasks.bigip.shared.file_transfer.uploads import ( - f5_bigip_shared_file_transfer_uploads, + bigip_shared_file_transfer_uploads, ) from nornir_f5.plugins.tasks.bigip.shared.iapp.package_management_tasks import ( - f5_bigip_shared_iapp_lx_package, + bigip_shared_iapp_lx_package, ) -from nornir_f5.plugins.tasks.bigip.sys.version import f5_bigip_sys_version -from nornir_f5.plugins.tasks.bigip.util.unix_ls import f5_bigip_util_unix_ls -from nornir_f5.plugins.tasks.bigip.util.unix_rm import f5_bigip_util_unix_rm +from nornir_f5.plugins.tasks.bigip.sys.version import bigip_sys_version +from nornir_f5.plugins.tasks.bigip.util.unix_ls import bigip_util_unix_ls +from nornir_f5.plugins.tasks.bigip.util.unix_rm import bigip_util_unix_rm __all__ = ( - "f5_atc", - "f5_bigip_cm_config_sync", - "f5_bigip_cm_failover_status", - "f5_bigip_cm_sync_status", - "f5_bigip_shared_file_transfer_uploads", - "f5_bigip_shared_iapp_lx_package", - "f5_bigip_sys_version", - "f5_bigip_util_unix_ls", - "f5_bigip_util_unix_rm", + "atc", + "bigip_cm_config_sync", + "bigip_cm_failover_status", + "bigip_cm_sync_status", + "bigip_shared_file_transfer_uploads", + "bigip_shared_iapp_lx_package", + "bigip_sys_version", + "bigip_util_unix_ls", + "bigip_util_unix_rm", ) diff --git a/nornir_f5/plugins/tasks/atc.py b/nornir_f5/plugins/tasks/atc.py index d603420..e89e00f 100644 --- a/nornir_f5/plugins/tasks/atc.py +++ b/nornir_f5/plugins/tasks/atc.py @@ -60,9 +60,9 @@ def _build_as3_endpoint( atc_config_endpoint: str, atc_method: str, as3_version: str, - as3_tenant: str = "", as3_show: str = "", as3_show_hash: bool = False, + as3_tenant: str = "", ) -> str: # Setup AS3 endpoint with specified tenant when tenant specified if as3_tenant and ( @@ -167,7 +167,7 @@ def _wait_task( raise Exception("The task has reached maximum retries.") -def f5_atc( +def atc( task: Task, as3_show: str = "base", as3_show_hash: bool = False, diff --git a/nornir_f5/plugins/tasks/bigip/cm/config_sync.py b/nornir_f5/plugins/tasks/bigip/cm/config_sync.py index dedab38..38c88e6 100644 --- a/nornir_f5/plugins/tasks/bigip/cm/config_sync.py +++ b/nornir_f5/plugins/tasks/bigip/cm/config_sync.py @@ -6,12 +6,12 @@ from nornir.core.task import Result, Task from nornir_f5.plugins.connections import f5_rest_client -from nornir_f5.plugins.tasks.bigip.cm.sync_status import f5_bigip_cm_sync_status +from nornir_f5.plugins.tasks.bigip.cm.sync_status import bigip_cm_sync_status SYNC_DIRECTION_OPTIONS = ["to-group", "from-group"] -def f5_bigip_cm_config_sync( +def bigip_cm_config_sync( task: Task, device_group: str, delay: int = 6, @@ -46,7 +46,7 @@ def f5_bigip_cm_config_sync( """ sync_status = task.run( name="Get the sync status", - task=f5_bigip_cm_sync_status, + task=bigip_cm_sync_status, severity_level=logging.DEBUG, ).result @@ -66,7 +66,7 @@ def f5_bigip_cm_config_sync( time.sleep(delay) sync_status = task.run( name=f"Get the sync status (attempt {retry}/{retries})", - task=f5_bigip_cm_sync_status, + task=bigip_cm_sync_status, severity_level=logging.DEBUG, ).result diff --git a/nornir_f5/plugins/tasks/bigip/cm/failover_status.py b/nornir_f5/plugins/tasks/bigip/cm/failover_status.py index e1b2147..df87518 100644 --- a/nornir_f5/plugins/tasks/bigip/cm/failover_status.py +++ b/nornir_f5/plugins/tasks/bigip/cm/failover_status.py @@ -5,7 +5,7 @@ from nornir_f5.plugins.connections import f5_rest_client -def f5_bigip_cm_failover_status(task: Task) -> Result: +def bigip_cm_failover_status(task: Task) -> Result: """Task to get the failover status of the device. Args: diff --git a/nornir_f5/plugins/tasks/bigip/cm/sync_status.py b/nornir_f5/plugins/tasks/bigip/cm/sync_status.py index 919ecc3..43f3453 100644 --- a/nornir_f5/plugins/tasks/bigip/cm/sync_status.py +++ b/nornir_f5/plugins/tasks/bigip/cm/sync_status.py @@ -5,7 +5,7 @@ from nornir_f5.plugins.connections import f5_rest_client -def f5_bigip_cm_sync_status(task: Task) -> Result: +def bigip_cm_sync_status(task: Task) -> Result: """Task to get the synchronization status of the device. Args: diff --git a/nornir_f5/plugins/tasks/bigip/shared/file_transfer/uploads.py b/nornir_f5/plugins/tasks/bigip/shared/file_transfer/uploads.py index 4b48324..3055d8d 100644 --- a/nornir_f5/plugins/tasks/bigip/shared/file_transfer/uploads.py +++ b/nornir_f5/plugins/tasks/bigip/shared/file_transfer/uploads.py @@ -51,7 +51,7 @@ def _upload_file( return Result(host=task.host, result="The file was uploaded successfully.") -def f5_bigip_shared_file_transfer_uploads( +def bigip_shared_file_transfer_uploads( task: Task, local_file_path: str, destination_file_name: str = None ) -> Result: """Upload a file to a BIG-IP system using the iControl REST API. @@ -63,7 +63,7 @@ def f5_bigip_shared_file_transfer_uploads( on the remote device. Returns: - Result: True if the upload was succesful. + Result: The result of the task. """ host = f"{task.host.hostname}:{task.host.port}" uri = f"{FILE_TRANSFER_OPTIONS['file']['endpoints']['uploads']['uri']}" diff --git a/nornir_f5/plugins/tasks/bigip/shared/iapp/package_management_tasks.py b/nornir_f5/plugins/tasks/bigip/shared/iapp/package_management_tasks.py index 35384e4..ce8ddd6 100644 --- a/nornir_f5/plugins/tasks/bigip/shared/iapp/package_management_tasks.py +++ b/nornir_f5/plugins/tasks/bigip/shared/iapp/package_management_tasks.py @@ -8,11 +8,11 @@ from nornir_f5.plugins.connections import f5_rest_client from nornir_f5.plugins.tasks.bigip.shared.file_transfer.uploads import ( FILE_TRANSFER_OPTIONS, - f5_bigip_shared_file_transfer_uploads, + bigip_shared_file_transfer_uploads, ) -from nornir_f5.plugins.tasks.bigip.sys.version import f5_bigip_sys_version -from nornir_f5.plugins.tasks.bigip.util.unix_ls import f5_bigip_util_unix_ls -from nornir_f5.plugins.tasks.bigip.util.unix_rm import f5_bigip_util_unix_rm +from nornir_f5.plugins.tasks.bigip.sys.version import bigip_sys_version +from nornir_f5.plugins.tasks.bigip.util.unix_ls import bigip_util_unix_ls +from nornir_f5.plugins.tasks.bigip.util.unix_rm import bigip_util_unix_rm def _wait_task( @@ -43,7 +43,7 @@ def _wait_task( raise Exception("The task has reached maximum retries.") -def f5_bigip_shared_iapp_lx_package( +def bigip_shared_iapp_lx_package( task: Task, package: str, delay: int = 3, @@ -73,7 +73,7 @@ def f5_bigip_shared_iapp_lx_package( client = f5_rest_client(task) # Check if LX is supported on the BIG-IP - version = task.run(name="Get system version", task=f5_bigip_sys_version).result + version = task.run(name="Get system version", task=bigip_sys_version).result if Version(version) < Version("12.0.0"): raise Exception(f"BIG-IP version '{version}' is not supported.") @@ -84,14 +84,14 @@ def f5_bigip_shared_iapp_lx_package( # Check if the file exists on the device content = task.run( name="List content", - task=f5_bigip_util_unix_ls, + task=bigip_util_unix_ls, file_path=remote_package_path, ).result if "No such file or directory" in content: # Upload the RPM on the BIG-IP task.run( name="Upload the RPM on the BIG-IP", - task=f5_bigip_shared_file_transfer_uploads, + task=bigip_shared_file_transfer_uploads, local_file_path=package, ) @@ -133,7 +133,7 @@ def f5_bigip_shared_iapp_lx_package( if not retain_package_file: task.run( name="Remove LX package", - task=f5_bigip_util_unix_rm, + task=bigip_util_unix_rm, file_path=remote_package_path, ) return Result( diff --git a/nornir_f5/plugins/tasks/bigip/sys/version.py b/nornir_f5/plugins/tasks/bigip/sys/version.py index 0dc80f0..9c8779e 100644 --- a/nornir_f5/plugins/tasks/bigip/sys/version.py +++ b/nornir_f5/plugins/tasks/bigip/sys/version.py @@ -5,7 +5,7 @@ from nornir_f5.plugins.connections import f5_rest_client -def f5_bigip_sys_version(task: Task) -> Result: +def bigip_sys_version(task: Task) -> Result: """Gets the system version of the BIG-IP. Args: diff --git a/nornir_f5/plugins/tasks/bigip/util/unix_ls.py b/nornir_f5/plugins/tasks/bigip/util/unix_ls.py index 89d2d71..4d72827 100644 --- a/nornir_f5/plugins/tasks/bigip/util/unix_ls.py +++ b/nornir_f5/plugins/tasks/bigip/util/unix_ls.py @@ -5,7 +5,7 @@ from nornir_f5.plugins.connections import f5_rest_client -def f5_bigip_util_unix_ls(task: Task, file_path: str) -> Result: +def bigip_util_unix_ls(task: Task, file_path: str) -> Result: """Task to list information about the FILEs. Args: diff --git a/nornir_f5/plugins/tasks/bigip/util/unix_rm.py b/nornir_f5/plugins/tasks/bigip/util/unix_rm.py index 3a497b9..86a0583 100644 --- a/nornir_f5/plugins/tasks/bigip/util/unix_rm.py +++ b/nornir_f5/plugins/tasks/bigip/util/unix_rm.py @@ -5,7 +5,7 @@ from nornir_f5.plugins.connections import f5_rest_client -def f5_bigip_util_unix_rm(task: Task, file_path: str) -> Result: +def bigip_util_unix_rm(task: Task, file_path: str) -> Result: """Task to delete a file from a BIG-IP system. Args: diff --git a/poetry.lock b/poetry.lock index c5ce113..81e9033 100644 --- a/poetry.lock +++ b/poetry.lock @@ -310,7 +310,7 @@ smmap = ">=3.0.1,<4" [[package]] name = "gitpython" -version = "3.1.12" +version = "3.1.13" description = "Python Git Library" category = "dev" optional = false @@ -865,8 +865,8 @@ gitdb = [ {file = "gitdb-4.0.5.tar.gz", hash = "sha256:c9e1f2d0db7ddb9a704c2a0217be31214e91a4fe1dea1efad19ae42ba0c285c9"}, ] gitpython = [ - {file = "GitPython-3.1.12-py3-none-any.whl", hash = "sha256:867ec3dfb126aac0f8296b19fb63b8c4a399f32b4b6fafe84c4b10af5fa9f7b5"}, - {file = "GitPython-3.1.12.tar.gz", hash = "sha256:42dbefd8d9e2576c496ed0059f3103dcef7125b9ce16f9d5f9c834aed44a1dac"}, + {file = "GitPython-3.1.13-py3-none-any.whl", hash = "sha256:c5347c81d232d9b8e7f47b68a83e5dc92e7952127133c5f2df9133f2c75a1b29"}, + {file = "GitPython-3.1.13.tar.gz", hash = "sha256:8621a7e777e276a5ec838b59280ba5272dd144a18169c36c903d8b38b99f750a"}, ] idna = [ {file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"}, diff --git a/tests/test_atc_tasks.py b/tests/test_atc_tasks.py index f427e14..eae9ff6 100644 --- a/tests/test_atc_tasks.py +++ b/tests/test_atc_tasks.py @@ -4,7 +4,7 @@ import pytest import responses -from nornir_f5.plugins.tasks import f5_atc +from nornir_f5.plugins.tasks import atc from .conftest import assert_result, base_decl_dir, base_resp_dir, load_json @@ -245,7 +245,7 @@ def get_task_callback(request): nornir = nornir.filter(name="bigip1.localhost") result = nornir.run( name="Deploy AS3 Declaration", - task=f5_atc, + task=atc, atc_delay=0, atc_retries=3, **kwargs, @@ -335,7 +335,7 @@ def get_task_callback(request): nornir = nornir.filter(name="bigip1.localhost") result = nornir.run( name="Deploy DO Declaration", - task=f5_atc, + task=atc, atc_delay=0, atc_retries=3, **kwargs, diff --git a/tests/test_bigip_cm_tasks.py b/tests/test_bigip_cm_tasks.py index a357acd..83cdaef 100644 --- a/tests/test_bigip_cm_tasks.py +++ b/tests/test_bigip_cm_tasks.py @@ -4,9 +4,9 @@ import responses from nornir_f5.plugins.tasks import ( - f5_bigip_cm_config_sync, - f5_bigip_cm_failover_status, - f5_bigip_cm_sync_status, + bigip_cm_config_sync, + bigip_cm_failover_status, + bigip_cm_sync_status, ) from .conftest import assert_result, base_resp_dir, load_json @@ -36,7 +36,7 @@ def test_get_failover_status(nornir, resp, expected): # Run task nornir = nornir.filter(name="bigip1.localhost") - result = nornir.run(name="Failover status GET", task=f5_bigip_cm_failover_status) + result = nornir.run(name="Failover status GET", task=bigip_cm_failover_status) # Assert result assert_result(result, expected) @@ -66,7 +66,7 @@ def test_get_sync_status(nornir, resp, expected): # Run task nornir = nornir.filter(name="bigip1.localhost") - result = nornir.run(name="Sync status GET", task=f5_bigip_cm_sync_status) + result = nornir.run(name="Sync status GET", task=bigip_cm_sync_status) # Assert result assert_result(result, expected) @@ -160,7 +160,7 @@ def get_sync_status_callback(request): nornir = nornir.filter(name="bigip1.localhost") result = nornir.run( name="Sync config", - task=f5_bigip_cm_config_sync, + task=bigip_cm_config_sync, delay=0, device_group="device_sync_group", retries=3, diff --git a/tests/test_bigip_shared_tasks.py b/tests/test_bigip_shared_tasks.py index 9cd93ae..e9e23d6 100644 --- a/tests/test_bigip_shared_tasks.py +++ b/tests/test_bigip_shared_tasks.py @@ -5,8 +5,8 @@ import responses from nornir_f5.plugins.tasks import ( - f5_bigip_shared_file_transfer_uploads, - f5_bigip_shared_iapp_lx_package, + bigip_shared_file_transfer_uploads, + bigip_shared_iapp_lx_package, ) from .conftest import assert_result, base_resp_dir, load_json @@ -65,7 +65,7 @@ def test_upload_file(nornir, kwargs, resp, expected): nornir = nornir.filter(name="bigip1.localhost") result = nornir.run( name="Upload file", - task=f5_bigip_shared_file_transfer_uploads, + task=bigip_shared_file_transfer_uploads, **kwargs, ) @@ -263,7 +263,7 @@ def get_task_callback(request): nornir = nornir.filter(name="bigip1.localhost") result = nornir.run( name="Manage LX package", - task=f5_bigip_shared_iapp_lx_package, + task=bigip_shared_iapp_lx_package, delay=0, retries=3, **kwargs, diff --git a/tests/test_bigip_sys_tasks.py b/tests/test_bigip_sys_tasks.py index 17f7d58..59f0623 100644 --- a/tests/test_bigip_sys_tasks.py +++ b/tests/test_bigip_sys_tasks.py @@ -1,7 +1,7 @@ import pytest import responses -from nornir_f5.plugins.tasks import f5_bigip_sys_version +from nornir_f5.plugins.tasks import bigip_sys_version from .conftest import assert_result, base_resp_dir, load_json @@ -30,7 +30,7 @@ def test_get_version(nornir, resp, expected): # Run task nornir = nornir.filter(name="bigip1.localhost") - result = nornir.run(name="Systen version GET", task=f5_bigip_sys_version) + result = nornir.run(name="Systen version GET", task=bigip_sys_version) # Assert result assert_result(result, expected) diff --git a/tests/test_bigip_util_tasks.py b/tests/test_bigip_util_tasks.py index 2f69c85..7902520 100644 --- a/tests/test_bigip_util_tasks.py +++ b/tests/test_bigip_util_tasks.py @@ -1,7 +1,7 @@ import pytest import responses -from nornir_f5.plugins.tasks import f5_bigip_util_unix_ls, f5_bigip_util_unix_rm +from nornir_f5.plugins.tasks import bigip_util_unix_ls, bigip_util_unix_rm from .conftest import assert_result, base_resp_dir, load_json @@ -47,7 +47,7 @@ def test_list_files(nornir, file, resp, expected): # Run task nornir = nornir.filter(name="bigip1.localhost") - result = nornir.run(name="List files", task=f5_bigip_util_unix_ls, file_path=file) + result = nornir.run(name="List files", task=bigip_util_unix_ls, file_path=file) # Assert result assert_result(result, expected) @@ -77,7 +77,7 @@ def test_remove_file(nornir, file, resp, expected): # Run task nornir = nornir.filter(name="bigip1.localhost") - result = nornir.run(name="Remove file", task=f5_bigip_util_unix_rm, file_path=file) + result = nornir.run(name="Remove file", task=bigip_util_unix_rm, file_path=file) # Assert result assert_result(result, expected) diff --git a/tests/test_readme.py b/tests/test_readme.py index 5d83b85..956ba94 100644 --- a/tests/test_readme.py +++ b/tests/test_readme.py @@ -7,9 +7,9 @@ import responses from nornir_f5.plugins.tasks import ( - f5_atc, - f5_bigip_cm_config_sync, - f5_bigip_cm_failover_status, + atc, + bigip_cm_config_sync, + bigip_cm_failover_status, ) from .conftest import base_resp_dir, load_json @@ -17,13 +17,13 @@ def as3_post(task: Task, as3_tenant: str) -> Result: failover_status = task.run( - name="Get failover status", task=f5_bigip_cm_failover_status + name="Get failover status", task=bigip_cm_failover_status ).result if failover_status == "ACTIVE": task.run( name="AS3 POST", - task=f5_atc, + task=atc, atc_delay=0, atc_method="POST", atc_retries=3, @@ -36,7 +36,7 @@ def as3_post(task: Task, as3_tenant: str) -> Result: task.run( name="Synchronize the devices", - task=f5_bigip_cm_config_sync, + task=bigip_cm_config_sync, delay=0, device_group=task.host["device_group"], retries=3,