Example #1
0
def version_file(eq_addr_, conf_, ext_):

    ##########  Description  #######
    '''
    '''
    #############  BODY ############

    path_ = '%s/PSEF_CONF/EQ_CONF/%s.%s' % (PSEFABRIC, eq_addr_, ext_)
    if not os.path.isfile(path_):
        open(path_, 'a')
    if (vrs.VersionFile(path_)):
        with open(path_, 'w') as f10:
            f10.write(conf_)
            f10.flush()
    else:
        print("Versioning file failed")
Example #2
0
def version_file(dict_name, dict_debug):

##########  Description  #######
    '''
    '''
#############  BODY ############

    path_ = '%s/PSEF_LOGS/%s.txt' % (PSEFABRIC , dict_name)
    if not  os.path.isfile(path_):
        open(path_, 'a+')
    if (vrs.VersionFile(path_)):
        with open(path_, 'w') as f10:
            f10.write(dict_debug)
            f10.flush()
    else:
        print ("Versioning file failed")
Example #3
0
def version_file(flg_ok_):
    if (re.search(flg_ok_, "OK")):
        if os.path.isfile("%s/PSEF_CONF/pse-config.xml" % PSEFABRIC):
            if (vrs.VersionFile("%s/PSEF_CONF/pse-config.xml" % PSEFABRIC)):
                with open('%s/PSEF_CONF/pse-config.xml' % PSEFABRIC,
                          'w') as f3:
                    f3.write(c)
                    f3.flush()
                print("OK")
            else:
                print("Versioning file failed")
        else:
            if (os.system(
                    "cp $PSEFABRIC/PSEF_CONF/pse-config-initial.xml $PSEFABRIC/PSEF_CONF/pse-config.xml.000 2>/dev/null"
            )):
                print("cp pse-config-initial.xml pse-config.xml failed")
            else:
                with open('%s/PSEF_CONF/pse-config.xml' % PSEFABRIC,
                          'w') as f4:
                    f4.write(c)
                    f4.flush()
                print("OK")