Skip to content

Commit

Permalink
set label_format based on Enstore wrapper :
Browse files Browse the repository at this point in the history
   cpio_odc -> 2
   cern -> null
  • Loading branch information
DmitryLitvintsev committed Feb 23, 2024
1 parent a7e158d commit cb717bc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion enstore2cta/scripts/enstore2cta.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ def insert_cta_tape_file_copy(connection,
%s,
0,
0,
'2',
%s,
'Enstore',
%s,
'',
Expand All @@ -801,6 +801,8 @@ def insert_cta_tape_file_copy(connection,
)
"""

# label_format is just before 'Enstore' above

def insert_cta_tape(connection, enstore_volume, config):
vo = enstore_volume["storage_group"]
logical_library_name = enstore_volume["library"]
Expand All @@ -815,6 +817,10 @@ def insert_cta_tape(connection, enstore_volume, config):
except KeyError:
raise

label_format = None
if enstore_volume["wrapper"] == "cpio_odc":
label_format = "2"

res = insert(connection,
INSERT_CTA_TAPE,(
enstore_volume["label"][:6],
Expand All @@ -827,6 +833,7 @@ def insert_cta_tape(connection, enstore_volume, config):
enstore_volume["active_bytes"],
enstore_volume["active_files"],
enstore_volume["active_bytes"],
label_format,
int(time.mktime(enstore_volume["declared"].timetuple())),
int(time.mktime(enstore_volume["last_access"].timetuple())),
int(time.mktime(enstore_volume["last_access"].timetuple())),
Expand Down

0 comments on commit cb717bc

Please sign in to comment.