#######################################################################################
#######################################################################################
#NIDD_VER: MNL17_1701_002_00
#MNL: MNL_MNL17_1701_002
#Migration from MNL17_1612_002 to MNL17_1701_002
#17.01.2017 / R. Biedka
#######################################################################################

#######################################################################################
#######################################################################################
#genereal version check

for_objects "MRBTS/MNL"
	begin
		if not ( get_version $current_dist_name ) == "MNL17_1612_002"
			abort_file
	end



#######################################################################################
#parameters additions

for_objects "MRBTS/MNL/MNLENT/FMCADM"
	begin
		if not ( param_exist $current_dist_name "actCategoryAlarms" ) add_param $current_dist_name "actCategoryAlarms" "false"
		if not ( param_exist $current_dist_name "actForceAutoReset" ) add_param $current_dist_name "actForceAutoReset" "false"
		if not ( param_exist $current_dist_name "actForceUnitAutoReset" ) add_param $current_dist_name "actForceUnitAutoReset" "false"
	end

for_objects "MRBTS/MNL/MNLENT/SECADM"
	begin
		if not ( param_exist $current_dist_name "passwdHistoryLength" ) add_param $current_dist_name "passwdHistoryLength" "0"
	end

for_objects "MRBTS/MNL/MNLENT/SYNC/CLOCK/TOP/TOPF"
	begin
		if ( not param_exist $current_dist_name "acceptedClockClass" )
		begin
			add_list $current_dist_name "acceptedClockClass"
			add_complex_param $current_dist_name "acceptedClockClass.0" 
			add_param $current_dist_name "acceptedClockClass.0"  "6"
		end
		if ( ( not param_exist $current_dist_name "topMasterList" ) && ( param_exist $current_dist_name "topMasters" ) )
		 begin
		    add_list $current_dist_name "topMasterList"
		    for_list $current_dist_name "topMasters"
		      begin
                add_complex_param $current_dist_name "topMasterList." JOIN $current_index
                define "masterIp" "topMasters." JOIN $current_index JOIN ".masterIpAddr"
                define "phaseErrorComp" "topMasters." JOIN $current_index JOIN ".phaseErrorComp"
                define "masterPriority1" "topMasters." JOIN $current_index JOIN ".priority_1"
                define "masterPriority2" "topMasters." JOIN $current_index JOIN ".priority_2"
                if ( param_exist $current_dist_name masterIp )
                    add_param $current_dist_name "topMasterList." JOIN $current_index JOIN ".masterIpAddr"  get_param $current_dist_name masterIp
                if ( param_exist $current_dist_name phaseErrorComp )
                    add_param $current_dist_name "topMasterList." JOIN $current_index JOIN ".phaseErrorComp" get_param $current_dist_name phaseErrorComp
                if ( param_exist $current_dist_name masterPriority1 )
                    add_param $current_dist_name "topMasterList." JOIN $current_index JOIN ".priority_1" get_param $current_dist_name masterPriority1
                if ( param_exist $current_dist_name masterPriority2 )
                    add_param $current_dist_name "topMasterList." JOIN $current_index JOIN ".priority_2" get_param $current_dist_name masterPriority2
		      end
		 end
	end

for_objects "MRBTS/MNL/MNLENT/SYNC/CLOCK/TOP/TOPP"
    begin
        define "toppDn" $current_dist_name

        if ( not param_exist toppDn "acceptedClockClass" )
            begin
                add_list toppDn "acceptedClockClass"
                add_complex_param toppDn "acceptedClockClass.0" 
                add_param toppDn "acceptedClockClass.0"  "6"
            end	

        if not ( param_exist toppDn "topMasterList" )
            begin
                if ( param_exist toppDn "topMasters" )
                    begin
                        add_list toppDn "topMasterList"
                        add_complex_param toppDn "topMasterList.0" 

                        if ( param_exist toppDn "topMasters.0.masterIpAddr" )
                            add_param toppDn "topMasterList.0.masterIpAddr" get_param toppDn "topMasters.0.masterIpAddr"

                        if ( param_exist toppDn "topMasters.0.phaseErrorComp" )
                            add_param toppDn "topMasterList.0.phaseErrorComp" get_param toppDn "topMasters.0.phaseErrorComp"

                        if ( param_exist toppDn "topMasters.0.topEthMulticastAddress" )
                            begin
                                define "topEthMulticastAddress" get_param toppDn "topMasters.0.topEthMulticastAddress"
                                add_param toppDn "topEthMulticastAddress" topEthMulticastAddress
                            end
                    end
            end
    end

#######################################################################################
#parameters removal

for_objects "MRBTS/MNL/MNLENT/SYNC/CLOCK/TOP/TOPF"
    begin
        if ( param_exist $current_dist_name "topMasters" )
            del_param $current_dist_name "topMasters"
    end

for_objects "MRBTS/MNL/MNLENT/SYNC/CLOCK/TOP/TOPP"
    begin
        if ( param_exist $current_dist_name "topMasters" )
            del_param $current_dist_name "topMasters"
    end

#######################################################################################	
#Set proper versions and adaptations to MNL subtree

for_objects "MRBTS/MNL"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end
	
for_objects "MRBTS/MNL/AMGR"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end
	
for_objects "MRBTS/MNL/AMGR/LUAC"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end
	
for_objects "MRBTS/MNL/MNLENT"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end
	
for_objects "MRBTS/MNL/MNLENT/BBADM"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end
	
for_objects "MRBTS/MNL/MNLENT/CAPADM"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end
	
for_objects "MRBTS/MNL/MNLENT/CAPADM/CAPLIM"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end
	
for_objects "MRBTS/MNL/MNLENT/CERTH"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end
	
for_objects "MRBTS/MNL/MNLENT/CERTH/CMP"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end
	
for_objects "MRBTS/MNL/MNLENT/CERTH/CRLH"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end
	
for_objects "MRBTS/MNL/MNLENT/CERTH/CRLH/CRLDPCONFIG"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end
	
for_objects "MRBTS/MNL/MNLENT/DNS"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end
	
for_objects "MRBTS/MNL/MNLENT/FEATCADM"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end
	
for_objects "MRBTS/MNL/MNLENT/MPLANENW"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/PMCADM"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/PMMNL"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/SECADM"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/SYNC"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/SYNC/CLOCK"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/SYNC/CLOCK/CLOCK_FDD"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
for_objects "MRBTS/MNL/MNLENT/SYNC/CLOCK/GNSSE"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/SYNC/CLOCK/NTP"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/SYNC/CLOCK/PDH"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/SYNC/CLOCK/SYNCE"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/SYNC/CLOCK/TOP"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/SYNC/CLOCK/TOP/TOPF"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	

for_objects "MRBTS/MNL/MNLENT/SYNC/CLOCK/TOP/TOPP"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/SYNC/TIME"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	

for_objects "MRBTS/MNL/MNLENT/TAC"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end		
	
for_objects "MRBTS/MNL/MNLENT/TAC/LTAC"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/TRBLCADM"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/CELLMAPPING"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/CELLMAPPING/LCELC"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/CELLMAPPING/LCELC/CHANNELGROUP"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/CELLMAPPING/LCELC/CHANNELGROUP/CHANNEL"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/CELLMAPPING/LCELW"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/CELLMAPPING/LCELW/CHANNELGROUP"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/CELLMAPPING/LCELW/CHANNELGROUP/CHANNEL"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	

for_objects "MRBTS/MNL/MNLENT/FMCADM"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/CELLMAPPING/LCELL"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/CELLMAPPING/LCELL/CHANNELGROUP"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
	
for_objects "MRBTS/MNL/MNLENT/CELLMAPPING/LCELL/CHANNELGROUP/CHANNEL"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	
for_objects "MRBTS/MNL/NOTES"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	

for_objects "MRBTS/MNL/NOTES/NOTE"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end	

for_objects "MRBTS/MNL/MNL_R"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end

for_objects "MRBTS/MNL/CMD"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end

for_objects "MRBTS/MNL/MNLENT/TRBLCADM/TRBLCADM_R"
	begin
		set_version $current_dist_name "MNL17_1701_002"
		set_adaptation $current_dist_name "com.nokia.srbts.mnl"
	end
#######################################################################################
