Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server info oop #192

Merged
merged 30 commits into from
Jan 21, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
443918a
Release(v2.7.5)
strizhechenko Jan 14, 2018
e4e6c31
Refactoring(server-info): Assessor -> Rater.
strizhechenko Jan 15, 2018
d918693
Refactoring(server-info): added new class structure (prototype).
strizhechenko Jan 15, 2018
d0ad0ce
Refactoring(server-info): removed argparse usage from Rater
strizhechenko Jan 15, 2018
26604c8
Refactoring(server-info): moved CPU rate from Rater to CPU
strizhechenko Jan 15, 2018
32c1bb2
Fixed(server-info): import extract directly from rater_math in CPU
strizhechenko Jan 15, 2018
91b1e0d
Restored(server-info): server-info-rate runs where missed in tests.
strizhechenko Jan 15, 2018
c78d793
Refactoring(server-info): base __init__/__rate for every subsystem
strizhechenko Jan 15, 2018
2f44e2d
Fixed(server-info): __rate in base class didn't worked because __, re…
strizhechenko Jan 15, 2018
5194e1e
Refactoring(server-info): moved last subsystem (system) to the separa…
strizhechenko Jan 15, 2018
95ee548
Refactoring(server-info): all subsystem-specific parsers moved to app…
strizhechenko Jan 15, 2018
ebf30f7
Refactoring(server-info): reader moved subsystem-specific data to app…
strizhechenko Jan 16, 2018
3c7fff2
Refactoring(server-info): yaml module -> yaml_tools to avoid conflicts
strizhechenko Jan 21, 2018
db82696
Refactoring(server-info): simplified any2int logic.
strizhechenko Jan 21, 2018
0bed6ee
Refactoring(server-info): simplified any2int logic.
strizhechenko Jan 21, 2018
c924fa8
Refactoring(server-info): parsing dmidecode output simplified
strizhechenko Jan 21, 2018
551849a
Refactoring(server-info): no six dependency > slightly higher memory …
strizhechenko Jan 21, 2018
9aa50a8
Refactoring(server-info): no six dependency > slightly higher memory …
strizhechenko Jan 21, 2018
dd4eb57
Refactoring(server-info): simplified invert_dict_nesting logic.
strizhechenko Jan 21, 2018
02d5e23
Refactoring(server-info): moved main logic from cli to Server class.
strizhechenko Jan 21, 2018
2ef2ca0
Refactoring(server-info): optimized imports.
strizhechenko Jan 21, 2018
e8b7889
Refactoring(server-info): naming in invert_dict_nesting
strizhechenko Jan 21, 2018
b24403d
Refactoring(server-info): removed Rater class, Server rates itself.
strizhechenko Jan 21, 2018
c82348c
Refactoring(server-info): removed Reader class, Server read its data …
strizhechenko Jan 21, 2018
e0c21a2
Fixed(server-info): syntax error
strizhechenko Jan 21, 2018
3833597
Refactoring(server-info): removed separate cli class, its Server's args
strizhechenko Jan 21, 2018
74e5bb3
Refactoring(server-info): specified exception type for str2int
strizhechenko Jan 21, 2018
202e5b0
Refactoring(server-info): removed -f / -ff / -fff args.
strizhechenko Jan 21, 2018
7310eda
Fixed(server-info): --rate didn't work without folding in py3
strizhechenko Jan 21, 2018
6bb5b0a
Refactoring(server-info): removed Collector class, Server collects it…
strizhechenko Jan 21, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactoring(server-info): added new class structure (prototype).
  • Loading branch information
strizhechenko committed Jan 15, 2018
commit d918693d429a2ff567875ad2ee3d9014b40bbc37
11 changes: 11 additions & 0 deletions netutils_linux_hardware/collector.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# coding=utf-8


class Collector(object):
@staticmethod
def copyfile(src, dst):
pass

@staticmethod
def catch_stdout(cmd, dst):
pass
7 changes: 7 additions & 0 deletions netutils_linux_hardware/cpu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# coding=utf-8

from netutils_linux_hardware.subsystem import Subsystem


class CPU(Subsystem):
pass
7 changes: 7 additions & 0 deletions netutils_linux_hardware/disk.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# coding=utf-8

from netutils_linux_hardware.subsystem import Subsystem


class Disk(Subsystem):
pass
7 changes: 7 additions & 0 deletions netutils_linux_hardware/memory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# coding=utf-8

from netutils_linux_hardware.subsystem import Subsystem


class Memory(Subsystem):
pass
7 changes: 7 additions & 0 deletions netutils_linux_hardware/net.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# coding=utf-8

from netutils_linux_hardware.subsystem import Subsystem


class Net(Subsystem):
pass
6 changes: 6 additions & 0 deletions netutils_linux_hardware/server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# coding=utf-8


class Server(object):
""" Knows about list of subsystems, folds data, etc """
pass
22 changes: 22 additions & 0 deletions netutils_linux_hardware/subsystem.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# coding=utf-8

from abc import abstractmethod


class Subsystem(object):
""" Base class for CPU, Memory, etc """

@abstractmethod
def collect(self):
""" Collecting required data from host """
pass

@abstractmethod
def parse(self):
""" Reading collected data from datadir """
pass

@abstractmethod
def rate(self):
""" Rating every detail in that data """
pass
7 changes: 7 additions & 0 deletions netutils_linux_hardware/system.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# coding=utf-8

from netutils_linux_hardware.subsystem import Subsystem


class System(Subsystem):
pass