Skip to content

Commit

Permalink
Enhancement: Run isort
Browse files Browse the repository at this point in the history
* Rucio is a first party, utils is a local folder.
  • Loading branch information
voetberg committed Aug 6, 2024
1 parent 37bba26 commit 8dd1980
Show file tree
Hide file tree
Showing 32 changed files with 72 additions and 54 deletions.
2 changes: 1 addition & 1 deletion atlas/check_ami
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import sys
import traceback

from rucio.db.sqla.session import get_session
from rucio.core.scope import add_scope
from rucio.db.sqla.session import get_session

# Exit statuses
OK, WARNING, CRITICAL, UNKNOWN = 0, 1, 2, 3
Expand Down
4 changes: 2 additions & 2 deletions atlas/check_disabled_rses
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
# limitations under the License.

import json
import requests
import sys
import traceback

import requests

from rucio.client import Client
from rucio.common.config import config_get
from rucio.common.exception import RSENotFound


UNKNOWN = 3
CRITICAL = 2
WARNING = 1
Expand Down
18 changes: 9 additions & 9 deletions atlas/check_lost_files
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import calendar
import mimetypes # to guess mimetype
import os
import sys
import smtplib
import sys
import time
import requests
import calendar
# from rucio.common.config import config_get
from datetime import date, datetime
from email import Encoders
from email.mime.text import MIMEText
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email import Encoders
import mimetypes # to guess mimetype
# from rucio.common.config import config_get
from datetime import datetime
from datetime import date
from email.MIMEMultipart import MIMEMultipart

# pandas to prepare statistics RSE:scope:count, may be used to re-implement all the script
import pandas as pd
import requests

from rucio.db.sqla.session import get_session

Expand Down
4 changes: 2 additions & 2 deletions atlas/check_map_voms_roles
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
import os
import sys

from VOMSAdmin.VOMSCommands import VOMSAdminProxy

from rucio.client import Client
from rucio.common.config import config_get
from rucio.common.exception import Duplicate

from VOMSAdmin.VOMSCommands import VOMSAdminProxy

UNKNOWN = 3
CRITICAL = 2
WARNING = 1
Expand Down
9 changes: 5 additions & 4 deletions atlas/check_quotas
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,20 @@
# Set quotas for all users on scratchdisk

from __future__ import print_function

import json
import sys

import requests

from rucio.api.rse import get_rse, parse_rse_expression, get_rse_usage, list_rse_attributes
from rucio.api.account import list_accounts
from rucio.api.account_limit import set_local_account_limit
from rucio.api.config import get
from rucio.db.sqla.session import get_session
from rucio.api.rse import (get_rse, get_rse_usage, list_rse_attributes,
parse_rse_expression)
from rucio.common.config import config_get
from rucio.common.exception import RucioException, RSENotFound, AccountNotFound

from rucio.common.exception import AccountNotFound, RSENotFound, RucioException
from rucio.db.sqla.session import get_session

UNKNOWN = 3
CRITICAL = 2
Expand Down
9 changes: 4 additions & 5 deletions atlas/check_rse_attributes
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ import json
import sys
import traceback


import requests

from rucio.db.sqla.session import get_session
from rucio.common.exception import RucioException, RSENotFound
from rucio.common.config import config_get
from rucio.core.rse import add_rse_attribute, get_rses_with_attribute, del_rse_attribute, get_rse_usage, get_rse
from rucio.common.exception import RSENotFound, RucioException
from rucio.core.rse import (add_rse_attribute, del_rse_attribute, get_rse,
get_rse_usage, get_rses_with_attribute)
from rucio.core.rse_expression_parser import parse_expression

from rucio.db.sqla.session import get_session

UNKNOWN = 3
CRITICAL = 2
Expand Down
3 changes: 2 additions & 1 deletion atlas/check_set_rse_space_limits
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@

import json
import sys
from urlparse import urlparse

import requests
from urlparse import urlparse

# Try to use server environment (direct database access). If that fails use
# client.
Expand Down
3 changes: 1 addition & 2 deletions atlas/check_site_status
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ import sys

import requests

from rucio.api.rse import get_rse_protocols, list_rses, update_rse
from rucio.common.config import config_get
from rucio.api.rse import list_rses, update_rse, get_rse_protocols
from rucio.transfertool.fts3 import FTS3Transfertool


UNKNOWN = 3
CRITICAL = 2
WARNING = 1
Expand Down
3 changes: 2 additions & 1 deletion atlas/check_storage_space
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ import sys

import gfal2

from rucio.api.rse import (get_rse, list_rse_attributes, list_rses,
set_rse_usage)
from rucio.common.config import config_get
from rucio.common.exception import RSEProtocolNotSupported
from rucio.rse import rsemanager as rsemgr
from rucio.api.rse import list_rses, list_rse_attributes, get_rse, set_rse_usage

OK, WARNING, CRITICAL, UNKNOWN = 0, 1, 2, 3

Expand Down
8 changes: 5 additions & 3 deletions atlas/check_sync_rses_with_cric
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ import requests

from rucio.api.account import list_accounts
from rucio.api.account_limit import set_local_account_limit
from rucio.api.rse import get_rse_protocols, add_protocol, add_rse, update_protocols
from rucio.api.rse import (add_protocol, add_rse, get_rse_protocols,
update_protocols)
from rucio.common.config import config_get
from rucio.common.exception import Duplicate, RSEProtocolPriorityError, RSEProtocolNotSupported, RSENotFound
from rucio.common.exception import (Duplicate, RSENotFound,
RSEProtocolNotSupported,
RSEProtocolPriorityError)
from rucio.db.sqla.constants import RSEType


UNKNOWN = 3
CRITICAL = 2
WARNING = 1
Expand Down
7 changes: 3 additions & 4 deletions atlas/check_voms
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ import sys
import time

import ldap # pylint: disable=import-error
from VOMSAdmin.VOMSCommands import \
VOMSAdminProxy # pylint: disable=import-error

from rucio.db.sqla.session import get_session
from rucio.client import Client
from rucio.common.config import config_get
from rucio.common.exception import Duplicate

from VOMSAdmin.VOMSCommands import VOMSAdminProxy # pylint: disable=import-error

from rucio.db.sqla.session import get_session

UNKNOWN = 3
CRITICAL = 2
Expand Down
11 changes: 6 additions & 5 deletions atlas/check_voms_admin
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@

import os
import re
import sys
import shlex
import subprocess

from rucio.api.account import list_accounts, add_account_attribute, del_account_attribute, list_account_attributes
from rucio.common.config import config_get
from rucio.common.exception import RucioException, Duplicate, AccountNotFound
import sys

from VOMSAdmin.VOMSCommands import VOMSAdminProxy

from rucio.api.account import (add_account_attribute, del_account_attribute,
list_account_attributes, list_accounts)
from rucio.common.config import config_get
from rucio.common.exception import AccountNotFound, Duplicate, RucioException

UNKNOWN = 3
CRITICAL = 2
WARNING = 1
Expand Down
6 changes: 2 additions & 4 deletions atlas/check_xcache
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ except ImportError:
# Python 3
from urllib.parse import urlparse

from rucio.db.sqla.session import get_session
from rucio.common.config import config_get
from rucio.common.exception import RucioException

from rucio.core.config import set as core_set
from rucio.core.config import items as core_items
from rucio.core.config import remove_option as core_del

from rucio.core.config import set as core_set
from rucio.db.sqla.session import get_session

UNKNOWN = 3
CRITICAL = 2
Expand Down
6 changes: 3 additions & 3 deletions cms/check_rse_files_rules
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ Probe to check the number of expected files per rse.
import sys
import traceback

from sqlalchemy import func

from rucio.db.sqla import models
from rucio.db.sqla.constants import RequestType
from rucio.db.sqla.constants import RuleState
from rucio.db.sqla.constants import RequestType, RuleState
from rucio.db.sqla.session import get_session
from sqlalchemy import func

from utils import common

Expand Down
5 changes: 3 additions & 2 deletions cms/check_rule_counts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ import sys
import traceback

from prometheus_client import CollectorRegistry, Gauge, push_to_gateway
from sqlalchemy import func

from rucio.common.config import config_get
from rucio.db.sqla import models
from rucio.db.sqla.constants import (RuleState)
from rucio.db.sqla.constants import RuleState
from rucio.db.sqla.session import get_session
from rucio.db.sqla.util import get_count
from sqlalchemy import func

from utils import common

Expand Down
3 changes: 2 additions & 1 deletion cms/check_rules_states_by_account
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ Probe that counts the number of stuck, replicating rules and waiting for approva
import sys
import traceback

from sqlalchemy import func

from rucio.common.types import InternalAccount
from rucio.db.sqla import models
from rucio.db.sqla.constants import RuleState
from rucio.db.sqla.session import get_session
from sqlalchemy import func

from utils import common

Expand Down
5 changes: 3 additions & 2 deletions cms/check_unlocked_replicas_per_rse
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ Probe to check the backlog of unlocked replicas per RSE.
"""

import sys
from datetime import (datetime, timedelta)
from datetime import datetime, timedelta

from sqlalchemy import func

from rucio.db.sqla import models
from rucio.db.sqla.session import get_session
from sqlalchemy import func

from utils import common

Expand Down
3 changes: 2 additions & 1 deletion cms/check_used_space
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Probe to check used space.
import sys
import traceback

from rucio.core.rse import list_rses, get_rse_usage, list_rse_attributes, get_rse_limits
from rucio.core.rse import (get_rse_limits, get_rse_usage, list_rse_attributes,
list_rses)
from rucio.db.sqla import models
from rucio.db.sqla.session import get_session

Expand Down
1 change: 1 addition & 0 deletions common/check_deletable_replicas
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Probe to check the queues of messages to submit by Hermes to the broker
'''

from __future__ import print_function

import sys

from rucio.db.sqla.session import get_session
Expand Down
1 change: 1 addition & 0 deletions common/check_expired_dids
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import traceback
from datetime import datetime

from prometheus_client import CollectorRegistry, Gauge, push_to_gateway

from rucio.common.config import config_get
from rucio.db.sqla import models
from rucio.db.sqla.session import get_session
Expand Down
1 change: 1 addition & 0 deletions common/check_expired_locked_rules
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Probe to check the locked expired rules or datasets with locked rules
'''

import sys

from rucio.db.sqla.session import get_session

# Exit statuses
Expand Down
2 changes: 1 addition & 1 deletion common/check_free_space
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Probe to check the min free space.
import sys
import traceback

from rucio.core.rse import list_rses, get_rse_limits, set_rse_usage
from rucio.core.rse import get_rse_limits, list_rses, set_rse_usage

# Exit statuses
OK, WARNING, CRITICAL, UNKNOWN = 0, 1, 2, 3
Expand Down
2 changes: 2 additions & 0 deletions common/check_fts_backlog
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ import sys

import requests
import urllib3

try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse

from prometheus_client import CollectorRegistry, Gauge, push_to_gateway

from rucio.common.config import config_get, config_get_bool
from rucio.core.distance import update_distances
from rucio.db.sqla.session import BASE, get_session
Expand Down
1 change: 1 addition & 0 deletions common/check_messages_to_submit
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ from __future__ import print_function
import sys

from prometheus_client import CollectorRegistry, Gauge, push_to_gateway

from rucio.common.config import config_get
from rucio.db.sqla.session import BASE, get_session

Expand Down
1 change: 1 addition & 0 deletions common/check_new_dids
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import sys
import traceback

from prometheus_client import CollectorRegistry, Gauge, push_to_gateway

from rucio.common.config import config_get
from rucio.db.sqla import models
from rucio.db.sqla.session import get_session
Expand Down
1 change: 1 addition & 0 deletions common/check_oracle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import re
import sys

import cx_Oracle

from rucio.common.config import config_get

from utils.common import probe_metrics
Expand Down
1 change: 1 addition & 0 deletions common/check_stuck_rules
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import sys
import traceback

from prometheus_client import CollectorRegistry, Gauge, push_to_gateway

from rucio.common.config import config_get
from rucio.db.sqla.session import BASE, get_session

Expand Down
1 change: 1 addition & 0 deletions common/check_transfer_queues_status
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ from __future__ import print_function
import sys

from prometheus_client import CollectorRegistry, Gauge, push_to_gateway

from rucio.common.config import config_get
from rucio.db.sqla.session import BASE, get_session

Expand Down
1 change: 1 addition & 0 deletions common/check_unevaluated_dids
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ from __future__ import print_function
import sys

from prometheus_client import CollectorRegistry, Gauge, push_to_gateway

from rucio.common.config import config_get
from rucio.db.sqla.session import BASE, get_session

Expand Down
Loading

0 comments on commit 8dd1980

Please sign in to comment.