#5356 fix(mirror_project_in): unused '--check' arg removed, description adjusted
Merged a year ago by ngompa. Opened a year ago by wombelix.

file modified
+4 -14
@@ -3,9 +3,6 @@ 

  from __future__ import print_function, absolute_import

  import os

  import argparse

- from datetime import datetime, timedelta

- 

- from sqlalchemy.exc import SQLAlchemyError

  

  import pagure.config

  import pagure.lib.model as model
@@ -22,13 +19,13 @@ 

  _config = pagure.config.reload_config()

  

  

- def main(check=False, debug=False):

-     """ The function pulls in all the changes from upstream"""

+ def main(debug=False):

+     """The function pulls in all the changes from upstream"""

  

      session = pagure.lib.model_base.create_session(_config["DB_URL"])

      projects = (

          session.query(model.Project)

-         .filter(model.Project.mirrored_from != None)

+         .filter(model.Project.mirrored_from is not None)

          .all()

      )

  
@@ -47,14 +44,7 @@ 

  

  if __name__ == "__main__":

      parser = argparse.ArgumentParser(

-         description="Script to send email before the api token expires"

-     )

-     parser.add_argument(

-         "--check",

-         dest="check",

-         action="store_true",

-         default=False,

-         help="Print the some output but does not send any email",

+         description="Script to PULL external repos into local (mirroring)"

      )

      parser.add_argument(

          "--debug",

Minor fix, mirror_project_in.py contained the arg check which wasn't used, also the description provided by the help output was from api_key_expire_mail.py. This PR removes the unused arg and adjusts the description to make clearer what the script is used for when triggered from the CLI.

2 new commits added

  • refactor(mirror_project_in): address 'flake8' findings
  • refactor(mirror_project_in): reformating based on 'black' findings
a year ago

rebased onto b277728

a year ago

Pull-Request has been merged by ngompa

a year ago
Metadata