Ejemplo n.º 1
0
def write_media_xml_to_db(config, session_id, device_code, db_media_xml_doc, username, password):
    
    #Ask user for confirmation to write media xml to database
    #update = raw_input('\nUpdate database with session-media metadata? [y/n]: ')
    xml_media_filename = session_id+'-'+device_code+'-media.xml' 
    xml_media_filepath = config.get('Dirs', 'tar_archive_dir')+'/'+xml_media_filename
    #if update == 'y':
    #   username = raw_input('username: '******'password: '******'\nDatabase updated'
    else:
        print '\nFailed to update database'
        ltoUtil.write_xml(db_media_xml_doc, xml_media_filepath)
        print '\nMedia xml saved to '+xml_media_filepath
Ejemplo n.º 2
0
def write_tape_xml_file(config, tape_xml_doc, tape_id):
    tape_xml_filepath = ltoUtil.get_tape_build_dir(config)+'/'+tape_id+'.xml'
    print 'Creating tape index file '+tape_xml_filepath
    ltoUtil.write_xml(tape_xml_doc, tape_xml_filepath)