- if getMetaData(s, img_num) == None:
- print "ERROR: No proper Deluge image found!"
- else:
- sreqpkt = SerialReqPacket((MSG_REPROG_BS, img_num, 0, 0, []))
- success = s.write_packet(SERIAL_AMGROUP, SERIAL_AMID, sreqpkt.payload())
- if success == True:
- packet = s.read_packet(SERIAL_AMGROUP, SERIAL_AMID)
- sreplypkt = SerialReplyPacket(packet[1])
- if sreplypkt.error == ERROR_SUCCESS:
- return True
- else:
- print "ERROR: Unable to reprogram the base station"
- return False
-
- print "ERROR: Unable to send the command"
+ metadata = getMetaData(s, img_num)
+ if not metadata == None:
+ if verifyMetaData(metadata) == True:
+ sreqpkt = SerialReqPacket((MSG_REPROG_BS, img_num, 0, 0, []))
+ success = s.write_packet(SERIAL_AMGROUP, SERIAL_AMID, sreqpkt.payload())
+ if success == True:
+ packet = s.read_packet(SERIAL_AMGROUP, SERIAL_AMID)
+ sreplypkt = SerialReplyPacket(packet[1])
+ if sreplypkt.error == ERROR_SUCCESS:
+ return True
+ else:
+ print "ERROR: Unable to reprogram the base station"
+
+ print "ERROR: Unable to send the command"
+