-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatacenter.py
46 lines (37 loc) · 1.18 KB
/
datacenter.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#########################################
# This project is a lab assignment #
# for the Essential Skills Module. #
# University of Amsterdam #
# MSc in System and Network Engineering #
# Nick Trintafyllidis. #
# Use it as you wish :) #
#########################################
import server
class Datacenter(object):
def __init__(self):
self.name = "OS3 Server Room"
self.servers = []
self.connections = []
def add_server(self,name,connection,owner):
temp = server.Server()
temp.name_it(name)
temp.connect(connection)
temp.assign(owner)
self.servers.append(temp)
def connect(self, connection):
self.connections.append(connection)
def printinfo(self):
print "*****"
print self.name
print "Machines:"
for i in self.servers:
print i.name + " " + i.owner + " " + i.connection
print "Connected to:"
for i in self.connections:
print i
print "*****"
def printall(self):
self.printinfo()
print "\t"
for i in self.servers:
i.printinfo()