forked from andaok/python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
27 lines (21 loc) · 838 Bytes
/
test.py
File metadata and controls
27 lines (21 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python
#-*- coding: utf-8 -*-
#=============================================================================
# FileName:
# Desc:
# Author: 苦咖啡
# Email: voilet@qq.com
# HomePage: http://blog.kukafei520.net
# Version: 0.0.1
# LastChange:
# History:
#=============================================================================
from assets.models import Host, IDC, Server_System, Cores, System_os, system_arch
server_data = open('/Users/voilet/opsautomation/jumei_optools/scripts/server_list.txt', 'r')
data = server_data.readlines()
server_data.close()
for i in data:
s = i.split()
# print i
host_data = Host(node_name=s[0], idc_id=1, eth1=s[0], brand="DELL", internal_ip=s[1], cabinet=s[2], editor=s[3], auto_install=1, sort="default")
host_data.save()