# -*- coding: utf-8 -*-
from migrate import *
from migrate.parts import *
from migrate.dns import *
from application import app
import sys

if __name__ == '__main__':
    with app.app_context():
        if '-dns_zone' in sys.argv:
            target = DnsZoneMigrate()
            target.run()

        if '-dns_apply' in sys.argv:
            target=DnsApplyMigrate()
            target.run()

        if '-parts_model' in sys.argv:
            target=ModelMigrate()
            target.run()

        if '-parts' in sys.argv:
            target=PartsMigrate()
            target.run()

        if '-users' in sys.argv:
            oauser=Users()
            oauser.run()

        if '-datacenter' in sys.argv:
            dctarget=dcmigrate()
            dctarget.run()

        if '-supply' in sys.argv:
            supplytarget=suppliermigrate()
            supplytarget.run()

        if '-ip' in sys.argv:
            iptarget=ipmigrate()
            iptarget.run()

        if '-rack' in sys.argv:
            racktarget=rackmigrate()
            racktarget.run()

        if '-devicecat' in sys.argv:
            devicecattarget=devicecatmigrate()
            devicecattarget.run()

        if '-device' in sys.argv:
            devicetarget=devicemigrate()
            devicetarget.run()

        if '-host' in sys.argv:
            hosttarget=hostmigrate()
            hosttarget.run()

        if '-pool' in sys.argv:
            pooltarget=Poolinit()
            pooltarget.run()

        if '-esbuild' in sys.argv:
            estarget=Rebuild()
            estarget.run()

        if '-over' in sys.argv:
            overjobtarget=overjobmigrate()
            overjobtarget.run()

        if '-repair' in  sys.argv:
            repairtarget=Repair()
            repairtarget.run()

        if '-compare' in sys.argv:
            compare=Compare_cmdb_zeus()
            compare.run()

        if '-dns_ip' in sys.argv:
            compare=Compare_cmdb_zeus()
            compare.run2()

        if '-urlcontent' in sys.argv:
            compare=Urlcontent()
            compare.run()

        if '-zabbix' in sys.argv:
            zabbix = ZabbixUser()
            zabbix.run();

        if '-sshkey' in sys.argv:
            sshkey = SshKey()
            sshkey.run();

        if '-Sapply' in sys.argv:
            sapply = Sapply()
            sapply.run();