From 22723888b48677f19b118a08acc3592bb6f9424a Mon Sep 17 00:00:00 2001 From: Mira Manninen Date: Sun, 23 Jul 2023 23:07:56 +0300 Subject: [PATCH 1/3] Change the parameter to be string --- plugins/module_utils/borgbase_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/module_utils/borgbase_client.py b/plugins/module_utils/borgbase_client.py index 7f4fa98..9a3cb81 100644 --- a/plugins/module_utils/borgbase_client.py +++ b/plugins/module_utils/borgbase_client.py @@ -55,7 +55,7 @@ class BorgBaseClient: ''' SSH_DELETE = ''' -mutation sshDelete($id: Int!) { +mutation sshDelete($id: String!) { sshDelete(id: $id) { ok } From e976f31a1c5c37508b4710399c8b0aca0a58b9ff Mon Sep 17 00:00:00 2001 From: Mira Manninen Date: Sun, 23 Jul 2023 23:14:54 +0300 Subject: [PATCH 2/3] Try setting up own namespace so I can use the fork for testing --- .github/workflows/release.yml | 14 +++++++------- .github/workflows/tests.yml | 12 ++++++------ galaxy.yml | 5 +++-- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 858597f..a4115b7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - path: ${{github.workspace}}/ansible_collections/adhawkins/borgbase + path: ${{github.workspace}}/ansible_collections/mireiawen/borgbase - name: Set up Python uses: actions/setup-python@v2 @@ -30,10 +30,10 @@ jobs: - name: Get the version id: get_version - run: echo ::set-output name=VERSION::$(grep "^version:" ${{ github.workspace }}/ansible_collections/adhawkins/borgbase/galaxy.yml | cut -f2 -d ' ') + run: echo ::set-output name=VERSION::$(grep "^version:" ${{ github.workspace }}/ansible_collections/mireiawen/borgbase/galaxy.yml | cut -f2 -d ' ') - name: Create checksum - working-directory: ${{github.workspace}}/adhawkins-borgbase-${{ steps.get_version.outputs.VERSION }}/ + working-directory: ${{github.workspace}}/mireiawen-borgbase-${{ steps.get_version.outputs.VERSION }}/ run: | sha256sum *.tar.gz > ${{github.workspace}}/checksum.txt @@ -41,13 +41,13 @@ jobs: if: startsWith(github.ref, 'refs/tags/') with: files: | - ${{github.workspace}}/adhawkins-borgbase-${{ steps.get_version.outputs.VERSION }}/*.tar.gz + ${{github.workspace}}/mireiawen-borgbase-${{ steps.get_version.outputs.VERSION }}/*.tar.gz checksum.txt - name: Upload to ansible-galaxy dev - run: ansible-galaxy collection publish --server https://galaxy-dev.ansible.com/ --token ${{ secrets.ANSIBLE_GALAXY_DEV_TOKEN }} ${{ github.workspace }}/adhawkins-borgbase-${{ steps.get_version.outputs.VERSION }}/*.tar.gz + run: ansible-galaxy collection publish --server https://galaxy-dev.ansible.com/ --token ${{ secrets.ANSIBLE_GALAXY_DEV_TOKEN }} ${{ github.workspace }}/mireiawen-borgbase-${{ steps.get_version.outputs.VERSION }}/*.tar.gz if: "contains(github.ref, 'test')" - name: Upload to ansible-galaxy - run: ansible-galaxy collection publish --token ${{ secrets.ANSIBLE_GALAXY_TOKEN }} ${{ github.workspace }}/adhawkins-borgbase-${{ steps.get_version.outputs.VERSION }}/*.tar.gz - if: "!contains(github.ref, 'test')" \ No newline at end of file + run: ansible-galaxy collection publish --token ${{ secrets.ANSIBLE_GALAXY_TOKEN }} ${{ github.workspace }}/mireiawen-borgbase-${{ steps.get_version.outputs.VERSION }}/*.tar.gz + if: "!contains(github.ref, 'test')" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4ee8e67..93beb16 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - path: ${{github.workspace}}/ansible_collections/adhawkins/borgbase + path: ${{github.workspace}}/ansible_collections/mireiawen/borgbase - name: Set up Python uses: actions/setup-python@v2 @@ -25,25 +25,25 @@ jobs: run: pip install ansible - name: Install module - working-directory: ${{github.workspace}}/ansible_collections/adhawkins/borgbase + working-directory: ${{github.workspace}}/ansible_collections/mireiawen/borgbase run: ansible-galaxy collection install . - name: Build module - working-directory: ${{github.workspace}}/ansible_collections/adhawkins/borgbase + working-directory: ${{github.workspace}}/ansible_collections/mireiawen/borgbase run: ansible-galaxy collection build --output-path ${{github.workspace}} - name: Display run: ls -l ${{github.workspace}} - name: Run test - working-directory: ${{github.workspace}}/ansible_collections/adhawkins/borgbase + working-directory: ${{github.workspace}}/ansible_collections/mireiawen/borgbase run: ansible-test sanity --docker --color yes -v - name: Get the version id: get_version - run: echo ::set-output name=VERSION::$(grep "^version:" ${{github.workspace}}/ansible_collections/adhawkins/borgbase/galaxy.yml | cut -f2 -d ' ') + run: echo ::set-output name=VERSION::$(grep "^version:" ${{github.workspace}}/ansible_collections/mireiawen/borgbase/galaxy.yml | cut -f2 -d ' ') - uses: actions/upload-artifact@v2 with: - name: adhawkins-borgbase-${{ steps.get_version.outputs.VERSION }} + name: mireiawen-borgbase-${{ steps.get_version.outputs.VERSION }} path: ${{github.workspace}}/*.tar.gz diff --git a/galaxy.yml b/galaxy.yml index 1342c89..9b6a89c 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -3,13 +3,13 @@ # The namespace of the collection. This can be a company/brand/organization or product namespace under which all # content lives. May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with # underscores or numbers and cannot contain consecutive underscores -namespace: adhawkins +namespace: mireiawen # The name of the collection. Has the same character restrictions as 'namespace' name: borgbase # The version of the collection. Must be compatible with semantic versioning -version: 1.0.3 +version: 1.0.4 # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md @@ -18,6 +18,7 @@ readme: README.md # @nicks:irc/im.site#channel' authors: - Andy Hawkins +- Mira Manninen ### OPTIONAL but strongly recommended From d1a13fd1c75fdcf6882992fb3a0ddf3033eda02b Mon Sep 17 00:00:00 2001 From: Mira Manninen Date: Fri, 22 Mar 2024 12:59:46 +0200 Subject: [PATCH 3/3] Change the sshDelete parameter to be String --- plugins/module_utils/borgbase_client.py | 2 +- plugins/modules/borgbase_ssh.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/module_utils/borgbase_client.py b/plugins/module_utils/borgbase_client.py index 06e01c6..7667672 100644 --- a/plugins/module_utils/borgbase_client.py +++ b/plugins/module_utils/borgbase_client.py @@ -55,7 +55,7 @@ class BorgBaseClient: ''' SSH_DELETE = ''' -mutation sshDelete($id: Int!) { +mutation sshDelete($id: String!) { sshDelete(id: $id) { ok } diff --git a/plugins/modules/borgbase_ssh.py b/plugins/modules/borgbase_ssh.py index 741fd81..8dcfbbb 100644 --- a/plugins/modules/borgbase_ssh.py +++ b/plugins/modules/borgbase_ssh.py @@ -253,7 +253,7 @@ def runModule(): if not module.check_mode: if deleteRequired: - deleteResult = deleteKey(int(foundKey['id']), apiKey=module.params['apikey']) + deleteResult = deleteKey(foundKey['id'], apiKey=module.params['apikey']) if not deleteResult['success']: result['msg'] = ' '