Coder Social home page Coder Social logo

Comments (6)

sm-gravid-day avatar sm-gravid-day commented on June 15, 2024 1

I get this too; RepoList is broken. If I remove the exception catching to get a full traceback it looks like:

Checking 'pypi-master' repository exists.
Traceback (most recent call last):
  File "/usr/local/bin/artifactory-cleanup", line 8, in <module>
    sys.exit(ArtifactoryCleanupCLI())
  File "/usr/local/lib/python3.8/site-packages/plumbum/cli/application.py", line 177, in __new__
    return cls.run()
  File "/usr/local/lib/python3.8/site-packages/plumbum/cli/application.py", line 634, in run
    retcode = inst.main(*tailargs)
  File "/usr/local/lib/python3.8/site-packages/artifactory_cleanup/cli.py", line 121, in main
    for summary in cleanup.cleanup(
  File "/usr/local/lib/python3.8/site-packages/artifactory_cleanup/artifactorycleanup.py", line 41, in cleanup
    policy.check()
  File "/usr/local/lib/python3.8/site-packages/artifactory_cleanup/rules/base.py", line 192, in check
    rule.check(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/artifactory_cleanup/rules/repo.py", line 52, in check
    repo.check(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/artifactory_cleanup/rules/repo.py", line 28, in check
    r = self.session.get(url)
AttributeError: 'NoneType' object has no attribute 'get'

Perhaps the BaseUrlSession object hasn't been initialised?

Everything works great for this repo on its own using just Repo.

from artifactory-cleanup.

sm-gravid-day avatar sm-gravid-day commented on June 15, 2024 1

@allburov there's a tiny fix here: #89

Please take a look.

from artifactory-cleanup.

NFerrovia avatar NFerrovia commented on June 15, 2024 1

That's great! Thank you for your hard work.

from artifactory-cleanup.

allburov avatar allburov commented on June 15, 2024

Could you get a full yaml configuration and the full traceback? You can remove your private data there

from artifactory-cleanup.

NFerrovia avatar NFerrovia commented on June 15, 2024

Sure, here's also the code running as intended on the normal repo & name config.

artifactory-cleanup:
  server: $ARTIFACTORY_SERVER
  user: $ARTIFACTORY_USERNAME
  password: $ARTIFACTORY_PASSWORD

  policies:
    - name: Remove all empty folders from repo1 
      rules:
        - rule: Repo
          name: "repo1"
        - rule: DeleteEmptyFolders

Which works as intended as seen here:

+----------------------------------------------------+-------------+------+
| Cleanup Policy                                     | Files count | Size |
+----------------------------------------------------+-------------+------+
| Remove all empty folders from ba-core-docker-local |    16474    | 299G |
|                                                    |             |      |
| Total size: 299G                                   |             |      |
+----------------------------------------------------+-------------+------+

But when i utilize Repolist:

artifactory-cleanup:
  server: $ARTIFACTORY_SERVER
  user: $ARTIFACTORY_USERNAME
  password: $ARTIFACTORY_PASSWORD

  policies:
    - name: Delete empty folders from [repo1, repo2, repo3]
      rules:
        - rule: RepoList
          repos:
            - repo1
            - repo2
            - repo3
        - rule: DeleteEmptyFolders

I get the aforementioned unceremonious error no traceback:

$ artifactory-cleanup
********************************************************************************
Verbose MODE
Checking 'repo1' repository exists.
Check failed for rule 'RepoList' in policy 'Delete empty folders from [repo1, repo2, repo3]':
'NoneType' object has no attribute 'get'

Which leads me to believe i have a formatting error, but this is what i gathered from the instructions.
I've tried different configurations but since i can't find a proper example on repoList i thought i'd open this issue with this question.

Just for clarification i replaced the repos with just placeholder names here but when i run the normal configuration above it has no problems finding the repos, i also tried the repos with or without quotes to the same result, not sure if that matters tho.

My artifactory-cleanup i believe is up to date:

$ artifactory-cleanup --version
artifactory-cleanup 1.0.3

from artifactory-cleanup.

NFerrovia avatar NFerrovia commented on June 15, 2024

Hello! Any news on this issue?

from artifactory-cleanup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.