-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlesson17.1.py
More file actions
23 lines (20 loc) · 787 Bytes
/
lesson17.1.py
File metadata and controls
23 lines (20 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class Servers:
def __init__(self,name,ip,os):
self.name = name
self.ip = ip
self.os = os
self.status = "stopped"
def start(self):
print(f"checking {self.name} systems ... ")
self.status = "running..."
print(f"--> {self.name} is now ON")
def stop(self):
print(f"stopping {self.name}")
self.status = "Stopped..."
print(f"--> {self.name} is now OFF")
my_server = Servers("app-001","10.0.0.1","Ubuntu")
sec_server= Servers("db-server", "10.0.0.2", "RedHat")
print(f" status of {my_server.name} before change is {my_server.status}")
my_server.start()
print(f"status after start {my_server.status} for {my_server.name}")
print(f"{sec_server.status} for {sec_server.name}")