From 5408903930724cf9ef656ed5f0183fd8624a33ce Mon Sep 17 00:00:00 2001 From: Olamide Ojo Date: Sun, 20 Oct 2024 15:36:56 +0100 Subject: [PATCH 1/7] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1f212e44..e9b8baa1 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ Create a dictionary to handle communication with the plug-in: Alternatively, you can use an existing Zowe CLI profile instead: ```python - from zowe.zos_core_for_zowe_sdk import ProfileManager + from zowe.core_for_zowe_sdk import ProfileManager from zowe.zos_console_for_zowe_sdk import Console profile = ProfileManager().load(profile_type="zosmf") From 016670e6b8d4231ecbb4bea7aebf02ccc51ba560 Mon Sep 17 00:00:00 2001 From: Olamide Ojo Date: Mon, 21 Oct 2024 11:14:15 +0100 Subject: [PATCH 2/7] remove deprecated methods Signed-off-by: Olamide Ojo --- CHANGELOG.md | 4 ++ tests/integration/test_zos_files.py | 60 ++++++++++++++--------------- 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d118fa03..f9cba0f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -139,3 +139,7 @@ All notable changes to the Zowe Client Python SDK will be documented in this fil - Fixed profile merge order to match Node.js SDK [#190](https://github.com/zowe/zowe-client-python-sdk/issues/190) - Fixed issue for datasets and jobs with special characters in URL [#211](https://github.com/zowe/zowe-client-python-sdk/issues/211) - Fixed exception handling in session.py [#213](https://github.com/zowe/zowe-client-python-sdk/issues/213) + +### Bug Fixes +- Updated the sample scripts in readmes to remove/ stop using methods that were deprecated in #276 +- Therefore this fixes #336 \ No newline at end of file diff --git a/tests/integration/test_zos_files.py b/tests/integration/test_zos_files.py index 29752582..3f89f527 100644 --- a/tests/integration/test_zos_files.py +++ b/tests/integration/test_zos_files.py @@ -47,7 +47,7 @@ def test_list_dsn_should_return_a_list_of_datasets(self): for scenario in scenarios: # Get the command output - command_output = self.files.list_dsn(self.files_fixtures["TEST_HLQ"], scenario["attributes"]) + command_output = self.files.ds.list(self.files_fixtures["TEST_HLQ"], scenario["attributes"]) # Assert that command_output['items'] is a list self.assertIsInstance(command_output, DatasetListResponse) @@ -65,38 +65,38 @@ def test_list_dsn_should_return_a_list_of_datasets(self): self.assertIn(expected_attr, attributes) def test_list_members_should_return_a_list_of_members(self): - """Executing list_dsn_members should return a list of members.""" - command_output = self.files.list_dsn_members(self.files_fixtures["TEST_PDS"]) + """Executing list_members should return a list of members.""" + command_output = self.files.ds.list_members(self.files_fixtures["TEST_PDS"]) self.assertIsInstance(command_output, MemberListResponse) - def test_get_dsn_content_should_return_content_from_dataset(self): - """Executing get_dsn_content should return content from dataset.""" - command_output = self.files.get_dsn_content(self.test_member_jcl) + def test_get_content_should_return_content_from_dataset(self): + """Executing gget_content should return content from dataset.""" + command_output = self.files.ds.get_content(self.test_member_jcl) self.assertIsInstance(command_output, str) - def test_get_dsn_content_streamed_should_return_response_content(self): - """Executing get_dsn_content_streamed should return response object from the server.""" - command_output = self.files.get_dsn_content_streamed(self.test_member_jcl) + def test_get_content_should_return_response_content(self): + """Executing get_content should return response object from the server.""" + command_output = self.files.ds.get_content(self.test_member_jcl) self.assertIsInstance(command_output.raw, urllib3.response.HTTPResponse) - def test_get_dsn_binary_content_streamed_should_return_response_content(self): - """Executing get_dsn_binary_content_streamed should return response object from the server.""" - command_output = self.files.get_dsn_binary_content_streamed(self.test_member_jcl) + def test_get_binary_content_should_return_response_content(self): + """Executing get_binary_content should return response object from the server.""" + command_output = self.files.ds.get_binary_content(self.test_member_jcl) self.assertIsInstance(command_output.raw, urllib3.response.HTTPResponse) def test_get_file_content_streamed_should_return_response_content(self): - """Executing get_dsn_binary_content_streamed should return response object from the server.""" - command_output = self.files.get_file_content_streamed(self.files_fixtures["TEST_USS"]) + """Executing get_binary_content should return response object from the server.""" + command_output = self.files.uss.get_content_streamed(self.files_fixtures["TEST_USS"]) self.assertIsInstance(command_output.raw, urllib3.response.HTTPResponse) - def test_write_to_dsn_should_be_possible(self): - """Executing write_to_dsn should be possible.""" - command_output = self.files.write_to_dsn(self.test_member_generic, "HELLO WORLD") + def test_write_should_be_possible(self): + """Executing write should be possible.""" + command_output = self.files.ds.write(self.test_member_generic, "HELLO WORLD") self.assertTrue(command_output == None) def test_copy_uss_to_data_set_should_be_possible(self): """Executing copy_uss_to_data_set should be possible.""" - command_output = self.files.copy_uss_to_data_set( + command_output = self.files.ds.copy_uss_to_data_set( self.files_fixtures["TEST_USS"], self.files_fixtures["TEST_PDS"] + "(TEST2)", replace=True ) self.assertTrue(command_output == None) @@ -110,7 +110,7 @@ def test_copy_data_set_or_member_should_be_possible(self): "to_member_name": "TEST", "replace": True, } - command_output = self.files.copy_data_set_or_member(**test_case) + command_output = self.files.ds.copy_data_set_or_member(**test_case) self.assertTrue(command_output == None) def test_mount_unmount_zfs_file_system(self): @@ -119,29 +119,29 @@ def test_mount_unmount_zfs_file_system(self): mount_point = self.files_fixtures["TEST_USS_MOUNT"] # Create a zfs file system - zfs_file_system = self.files.create_zfs_file_system(self.test2_zfs_file_system, self.create_zfs_options) + zfs_file_system = self.files.fs.create(self.test2_zfs_file_system, self.create_zfs_options) # Mount file system - command_output = self.files.mount_file_system( + command_output = self.files.fs.mount( self.test2_zfs_file_system, mount_point, self.mount_zfs_file_system_options ) self.assertTrue(command_output == None) # List a zfs file system - command_output = self.files.list_unix_file_systems(file_system_name=self.test2_zfs_file_system.upper()) + command_output = self.files.fs.list(file_system_name=self.test2_zfs_file_system.upper()) self.assertTrue(len(command_output["items"]) > 0) # Unmount file system - command_output = self.files.unmount_file_system(self.test2_zfs_file_system) + command_output = self.files.fs.unmount(self.test2_zfs_file_system) self.assertTrue(command_output == None) # Delete file system - command_output = self.files.delete_zfs_file_system(self.test2_zfs_file_system) + command_output = self.files.fs.delete(self.test2_zfs_file_system) self.assertTrue(command_output == None) def test_upload_download_delete_dataset(self): - self.files.upload_file_to_dsn(SAMPLE_JCL_FIXTURE_PATH, self.test_ds_upload) - self.files.download_dsn(self.test_ds_upload, SAMPLE_JCL_FIXTURE_PATH + ".tmp") + self.files.ds.upload_file(SAMPLE_JCL_FIXTURE_PATH, self.test_ds_upload) + self.files.ds.download(self.test_ds_upload, SAMPLE_JCL_FIXTURE_PATH + ".tmp") with open(SAMPLE_JCL_FIXTURE_PATH, "r") as in_file: old_file_content = in_file.read() @@ -149,17 +149,17 @@ def test_upload_download_delete_dataset(self): new_file_content = in_file.read().rstrip() self.assertEqual(old_file_content, new_file_content) - self.files.delete_data_set(self.files_fixtures["TEST_PDS"], member_name=self.files_fixtures["TEST_MEMBER_NEW"]) + self.Dataset.delete(self.files_fixtures["TEST_PDS"], member_name=self.files_fixtures["TEST_MEMBER_NEW"]) os.unlink(SAMPLE_JCL_FIXTURE_PATH + ".tmp") def test_upload_download_delete_uss(self): - self.files.upload_file_to_uss(SAMPLE_JCL_FIXTURE_PATH, self.test_uss_upload) - self.files.download_uss(self.test_uss_upload, SAMPLE_JCL_FIXTURE_PATH + ".tmp") + self.USSFiles.upload(SAMPLE_JCL_FIXTURE_PATH, self.test_uss_upload) + self.files.uss.download(self.test_uss_upload, SAMPLE_JCL_FIXTURE_PATH + ".tmp") with open(SAMPLE_JCL_FIXTURE_PATH, "r") as in_file: old_file_content = in_file.read() with open(SAMPLE_JCL_FIXTURE_PATH + ".tmp", "r") as in_file: new_file_content = in_file.read() self.assertEqual(old_file_content, new_file_content) - self.files.delete_uss(self.test_uss_upload) + self.files.uss.delete(self.test_uss_upload) os.unlink(SAMPLE_JCL_FIXTURE_PATH + ".tmp") From ed0514d670663b20c6cbdcd4e40fe817baee668e Mon Sep 17 00:00:00 2001 From: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com> Date: Tue, 29 Oct 2024 05:18:26 -0400 Subject: [PATCH 3/7] chore: update changelog :yum: Third-Party DCO Remediation Commit for Olamide Ojo On behalf of Olamide Ojo , I, Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 5408903930724cf9ef656ed5f0183fd8624a33ce Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com> Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com> --- CHANGELOG.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 688bb6fe..d39425ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ All notable changes to the Zowe Client Python SDK will be documented in this fil ### Bug Fixes - Fixed the inconsistent use of the SDK name across SDKs in all files by implementing the "find and replace" tool. [#328](https://github.com/zowe/zowe-client-python-sdk/issues/328) +- Updated the sample scripts in readmes to remove/ stop using methods that were deprecated in [#276](https://github.com/zowe/zowe-client-python-sdk/issues/276). [#336](https://github.com/zowe/zowe-client-python-sdk/issues/336) ## `1.0.0-dev21` @@ -143,7 +144,3 @@ All notable changes to the Zowe Client Python SDK will be documented in this fil - Fixed profile merge order to match Node.js SDK [#190](https://github.com/zowe/zowe-client-python-sdk/issues/190) - Fixed issue for datasets and jobs with special characters in URL [#211](https://github.com/zowe/zowe-client-python-sdk/issues/211) - Fixed exception handling in session.py [#213](https://github.com/zowe/zowe-client-python-sdk/issues/213) - -### Bug Fixes -- Updated the sample scripts in readmes to remove/ stop using methods that were deprecated in #276 -- Therefore this fixes #336 \ No newline at end of file From 6fccfa7362f4b879c6f0099f92460cd9c28f1d1d Mon Sep 17 00:00:00 2001 From: Olamide Ojo Date: Thu, 31 Oct 2024 23:25:43 +0100 Subject: [PATCH 4/7] Update sample scripts provided to users in various readme files Signed-off-by: Olamide Ojo --- CHANGELOG.md | 3 +-- samples/SampleFiles.py | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 688bb6fe..921929aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -145,5 +145,4 @@ All notable changes to the Zowe Client Python SDK will be documented in this fil - Fixed exception handling in session.py [#213](https://github.com/zowe/zowe-client-python-sdk/issues/213) ### Bug Fixes -- Updated the sample scripts in readmes to remove/ stop using methods that were deprecated in #276 -- Therefore this fixes #336 \ No newline at end of file +- Updated the sample scripts in readmes to remove/ stop using methods that were deprecated in #276. [#336](https://github.com/zowe/zowe-client-python-sdk/issues/336) \ No newline at end of file diff --git a/samples/SampleFiles.py b/samples/SampleFiles.py index fa92a6dc..5403b73c 100644 --- a/samples/SampleFiles.py +++ b/samples/SampleFiles.py @@ -9,7 +9,7 @@ # ----------------------------------------------------- print("...SYS1 datasets\n") my_files = Files(connection) -my_dsn_list = my_files.list_dsn("SYS1.**.*") +my_dsn_list = my_files.ds.list("SYS1.**.*") datasets = my_dsn_list["items"] for ds in datasets: print(ds["dsname"]) @@ -19,7 +19,7 @@ # ----------------------------------------------------- print("...files in /etc\n") -my_file_list = my_files.list_files("/etc") +my_file_list = my_files.uss.list("/etc") files = my_file_list["items"] for file in files: print(file["name"], file["mode"]) @@ -28,5 +28,5 @@ # Get the content of one of the files. # ----------------------------------------------------- print("...content of a file\n") -my_file_content = my_files.get_file_content("/z/tm891807/file.txt") +my_file_content = my_files.uss.get_content("/z/tm891807/file.txt") print(my_file_content) From 3a7ef1f4c583452783ffb8fbbe0a8dbf8bb4f1bd Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Mon, 11 Nov 2024 10:19:49 -0500 Subject: [PATCH 5/7] Fix failing integration tests Signed-off-by: Timothy Johnson --- tests/integration/test_zos_files.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integration/test_zos_files.py b/tests/integration/test_zos_files.py index 3f89f527..d62da9b8 100644 --- a/tests/integration/test_zos_files.py +++ b/tests/integration/test_zos_files.py @@ -77,12 +77,12 @@ def test_get_content_should_return_content_from_dataset(self): def test_get_content_should_return_response_content(self): """Executing get_content should return response object from the server.""" command_output = self.files.ds.get_content(self.test_member_jcl) - self.assertIsInstance(command_output.raw, urllib3.response.HTTPResponse) + self.assertIsInstance(command_output, str) def test_get_binary_content_should_return_response_content(self): """Executing get_binary_content should return response object from the server.""" command_output = self.files.ds.get_binary_content(self.test_member_jcl) - self.assertIsInstance(command_output.raw, urllib3.response.HTTPResponse) + self.assertIsInstance(command_output, bytes) def test_get_file_content_streamed_should_return_response_content(self): """Executing get_binary_content should return response object from the server.""" @@ -149,11 +149,11 @@ def test_upload_download_delete_dataset(self): new_file_content = in_file.read().rstrip() self.assertEqual(old_file_content, new_file_content) - self.Dataset.delete(self.files_fixtures["TEST_PDS"], member_name=self.files_fixtures["TEST_MEMBER_NEW"]) + self.files.ds.delete(self.files_fixtures["TEST_PDS"], member_name=self.files_fixtures["TEST_MEMBER_NEW"]) os.unlink(SAMPLE_JCL_FIXTURE_PATH + ".tmp") def test_upload_download_delete_uss(self): - self.USSFiles.upload(SAMPLE_JCL_FIXTURE_PATH, self.test_uss_upload) + self.files.uss.upload(SAMPLE_JCL_FIXTURE_PATH, self.test_uss_upload) self.files.uss.download(self.test_uss_upload, SAMPLE_JCL_FIXTURE_PATH + ".tmp") with open(SAMPLE_JCL_FIXTURE_PATH, "r") as in_file: old_file_content = in_file.read() From 51f7f08262b6d3ed9a97b3d6d74840957493802f Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Mon, 11 Nov 2024 10:22:29 -0500 Subject: [PATCH 6/7] Update changelog Signed-off-by: Timothy Johnson --- CHANGELOG.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86263b41..50f050dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,12 +6,12 @@ All notable changes to the Zowe Client Python SDK will be documented in this fil ### Enhancements -- Turning of logger at the class-constructor level [#316] (https://github.com/zowe/zowe-client-python-sdk/issues/316) +- Turning off logger at the class-constructor level [#316](https://github.com/zowe/zowe-client-python-sdk/issues/316) ### Bug Fixes -- Fixed the inconsistent use of the SDK name across SDKs in all files by implementing the "find and replace" tool. [#328](https://github.com/zowe/zowe-client-python-sdk/issues/328) -- Updated the sample scripts in readmes to remove/ stop using methods that were deprecated in [#276](https://github.com/zowe/zowe-client-python-sdk/issues/276). [#336](https://github.com/zowe/zowe-client-python-sdk/issues/336) +- Fixed the inconsistent use of the SDK name across SDKs in all files. [#328](https://github.com/zowe/zowe-client-python-sdk/issues/328) +- Updated the sample scripts in readmes to stop using methods that were deprecated in [#276](https://github.com/zowe/zowe-client-python-sdk/issues/276). [#336](https://github.com/zowe/zowe-client-python-sdk/issues/336) ## `1.0.0-dev21` @@ -144,7 +144,3 @@ All notable changes to the Zowe Client Python SDK will be documented in this fil - Fixed profile merge order to match Node.js SDK [#190](https://github.com/zowe/zowe-client-python-sdk/issues/190) - Fixed issue for datasets and jobs with special characters in URL [#211](https://github.com/zowe/zowe-client-python-sdk/issues/211) - Fixed exception handling in session.py [#213](https://github.com/zowe/zowe-client-python-sdk/issues/213) -<<<<<<< HEAD - -### Bug Fixes -- Updated the sample scripts in readmes to remove/ stop using methods that were deprecated in #276. [#336](https://github.com/zowe/zowe-client-python-sdk/issues/336) \ No newline at end of file From 3791e39433d19f8f01cb32d7799da2c53e173f3f Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Mon, 11 Nov 2024 10:24:09 -0500 Subject: [PATCH 7/7] Update comments in test Signed-off-by: Timothy Johnson --- tests/integration/test_zos_files.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_zos_files.py b/tests/integration/test_zos_files.py index d62da9b8..9a317158 100644 --- a/tests/integration/test_zos_files.py +++ b/tests/integration/test_zos_files.py @@ -70,7 +70,7 @@ def test_list_members_should_return_a_list_of_members(self): self.assertIsInstance(command_output, MemberListResponse) def test_get_content_should_return_content_from_dataset(self): - """Executing gget_content should return content from dataset.""" + """Executing get_content should return content from dataset.""" command_output = self.files.ds.get_content(self.test_member_jcl) self.assertIsInstance(command_output, str) @@ -85,7 +85,7 @@ def test_get_binary_content_should_return_response_content(self): self.assertIsInstance(command_output, bytes) def test_get_file_content_streamed_should_return_response_content(self): - """Executing get_binary_content should return response object from the server.""" + """Executing get_content_streamed should return response object from the server.""" command_output = self.files.uss.get_content_streamed(self.files_fixtures["TEST_USS"]) self.assertIsInstance(command_output.raw, urllib3.response.HTTPResponse)