Uploaded image for project: 'Project Quay'
  1. Project Quay
  2. PROJQUAY-5878

"python -m util.removelocation" won't report error when remove a nonexistent site

XMLWordPrintable

    • False
    • None
    • False
    • 0

      Description of problem:

      Remove a single site from quay geo-replication environment,  we use "python -m util.removelocation <site_name>" to clean up site information in quay DB. But if we try to remove a nonexistent site, there is no error message about this site doesn't exist.  

      quay=> select * from imagestoragelocation;
       id |       name        
      ----+-------------------
        1 | reg0storage
        3 | s3_us_east_1
        4 | s3_eu_west_1
        5 | s3_ap_southeast_1
        6 | s3_ap_southeast_2
        7 | s3_ap_northeast_1
        8 | s3_sa_east_1
        9 | local
       10 | s3_us_west_1
      
      
      sh-4.4$ python -m util.removelocation  1234
      /app/lib/python3.9/site-packages/tzlocal/unix.py:141: SyntaxWarning: "is not" with a literal. Did you mean "!="?
        while start is not 0:
      /app/lib/python3.9/site-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
        if x is 0 or x is 1:
      /app/lib/python3.9/site-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
        if x is 0 or x is 1:
      /app/lib/python3.9/site-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
        elif y is 0 or y is 1:
      /app/lib/python3.9/site-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
        elif y is 0 or y is 1:
      /app/lib/python3.9/site-packages/jmespath/visitor.py:260: SyntaxWarning: "is" with a literal. Did you mean "=="?
        if original_result is 0:
      /app/lib/python3.9/site-packages/netaddr/strategy/__init__.py:189: SyntaxWarning: "is not" with a literal. Did you mean "!="?
        if word_sep is not '':
      WARNING: This is a destructive operation. Are you sure you want to remove 1234 from your storage locations? [y/n] y
      Deleted location 1234

      The command output shows the nonexistent site 1234 was deleted successfully.  This output doesn't make sense. 

      When try to delete a  nonexistent site, "python -m util.removelocation" should give a error message. 

            jonathankingfc Jonathan King
            rhwhu Weihua Hu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: