Skip to content

Commit

Permalink
Merge pull request #521 from cmoussa1/fix.constants.styling
Browse files Browse the repository at this point in the history
`__init__.py`: fix formatting of constants
  • Loading branch information
mergify[bot] authored Oct 29, 2024
2 parents 4e82ad6 + c1b30d2 commit c2399c8
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/bindings/python/fluxacct/accounting/__init__.py.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
db_dir = "@X_LOCALSTATEDIR@/lib/flux/"
db_path = "@X_LOCALSTATEDIR@/lib/flux/FluxAccounting.db"
db_schema_version = 23
DB_DIR = "@X_LOCALSTATEDIR@/lib/flux/"
DB_PATH = "@X_LOCALSTATEDIR@/lib/flux/FluxAccounting.db"
DB_SCHEMA_VERSION = 23

__all__ = ["db_dir", "db_path", "db_schema_version"]
__all__ = ["DB_DIR", "DB_PATH", "DB_SCHEMA_VERSION"]
2 changes: 1 addition & 1 deletion src/bindings/python/fluxacct/accounting/create_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def create_db(
sys.exit(1)

# set version number of database
conn.execute("PRAGMA user_version = %d" % (fluxacct.accounting.db_schema_version))
conn.execute("PRAGMA user_version = %d" % (fluxacct.accounting.DB_SCHEMA_VERSION))

# Association Table
logging.info("Creating association_table in DB...")
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/flux-account-fetch-job-records.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


def set_db_loc(args):
path = args.path if args.path else fluxacct.accounting.db_path
path = args.path if args.path else fluxacct.accounting.DB_PATH

return path

Expand Down
4 changes: 2 additions & 2 deletions src/cmd/flux-account-priority-update.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


def set_db_loc(args):
path = args.path if args.path else fluxacct.accounting.db_path
path = args.path if args.path else fluxacct.accounting.DB_PATH

return path

Expand All @@ -49,7 +49,7 @@ def est_sqlite_conn(path):
cur = conn.cursor()
cur.execute("PRAGMA user_version")
db_version = cur.fetchone()[0]
if db_version < fluxacct.accounting.db_schema_version:
if db_version < fluxacct.accounting.DB_SCHEMA_VERSION:
print(
"""flux-accounting database out of date; updating DB with """
"""'flux account-update-db' before sending information to plugin"""
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/flux-account-service.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ def main():

# try to connect to flux-accounting database; if connection fails, exit
# flux-accounting service
db_path = args.path if args.path else fluxacct.accounting.db_path
db_path = args.path if args.path else fluxacct.accounting.DB_PATH
conn = establish_sqlite_connection(db_path)

# check version of database; if not up to date, output message
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/flux-account-update-db.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


def set_db_loc(args):
path = args.old_db if args.old_db else fluxacct.accounting.db_path
path = args.old_db if args.old_db else fluxacct.accounting.DB_PATH

return path

Expand Down Expand Up @@ -238,7 +238,7 @@ def update_db(path, new_db):

# update user_version for DB
old_cur.execute(
"PRAGMA user_version = %d" % (fluxacct.accounting.db_schema_version)
"PRAGMA user_version = %d" % (fluxacct.accounting.DB_SCHEMA_VERSION)
)

# commit changes
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/flux-account.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ def add_arguments_to_parser(parser, subparsers):


def set_db_location(args):
path = args.path if args.path else fluxacct.accounting.db_path
path = args.path if args.path else fluxacct.accounting.DB_PATH

return path

Expand Down

0 comments on commit c2399c8

Please sign in to comment.