Skip to content

Commit

Permalink
carnival.cli remove
Browse files Browse the repository at this point in the history
  • Loading branch information
a1fred committed Dec 3, 2021
1 parent b7670b2 commit f294b29
Show file tree
Hide file tree
Showing 12 changed files with 175 additions and 345 deletions.
2 changes: 0 additions & 2 deletions carnival/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from carnival.hosts.local import LocalHost, localhost_connection
from carnival.hosts.ssh import SshHost
from carnival.task import TaskBase, Task
from carnival import cmd
from carnival import internal_tasks


Expand Down Expand Up @@ -40,6 +39,5 @@
'SshHost', 'LocalHost', 'localhost_connection', 'Host', 'Connection', 'Result',
'Role', 'SingleRole',
'TaskBase', 'Task',
'cmd',
'internal_tasks',
]
18 changes: 0 additions & 18 deletions carnival/cmd/__init__.py

This file was deleted.

30 changes: 0 additions & 30 deletions carnival/cmd/cli.py

This file was deleted.

94 changes: 0 additions & 94 deletions carnival/cmd/fs.py

This file was deleted.

41 changes: 0 additions & 41 deletions carnival/cmd/system.py

This file was deleted.

135 changes: 0 additions & 135 deletions carnival/cmd/transfer.py

This file was deleted.

17 changes: 5 additions & 12 deletions carnival/hosts/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self, host: "Host") -> None:
"""
Конекст с хостом, все конекты являются контекст-менеджерами
>>> with host.connection() as c:
>>> with host.connect() as c:
>>> c.run("ls -1")
"""
Expand All @@ -63,7 +63,9 @@ def __exit__(self, *args: typing.Any) -> None:
def run(
self,
command: str,
hide: bool = False, warn: bool = False, cwd: typing.Optional[str] = None,
hide: bool = False,
warn: bool = False,
cwd: typing.Optional[str] = None,
) -> Result:
"""
Запустить команду
Expand All @@ -80,20 +82,11 @@ class Host:
Базовый класс для хостов
"""

addr: str
addr: str = ""
"""
Адрес хоста
"""

def __init__(
self,
) -> None:
"""
:param context: Контекст хоста
"""

self.addr = ""

@property
def ip(self) -> str:
# Maybe self.addr is ip?
Expand Down
1 change: 1 addition & 0 deletions carnival/hosts/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def __init__(
self,
host: "SshHost",
) -> None:
super().__init__(host)
self.host: "SshHost" = host

self._c: typing.Optional[FabricConnection] = None
Expand Down
3 changes: 2 additions & 1 deletion carnival/steps/_validator_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ def try_get(
fact_id: str,
) -> typing.Tuple[bool, typing.Optional[str]]:
global __vc
cachekey = __build_vc_key(step_class=step_class, host=host, fact_id=fact_id)

return (
__build_vc_key(step_class=step_class, host=host, fact_id=fact_id) in __vc,
cachekey in __vc,
__vc.get(
__build_vc_key(step_class=step_class, host=host, fact_id=fact_id),
None,
Expand Down
Loading

0 comments on commit f294b29

Please sign in to comment.