mirror of
https://gitlab.com/kupfer/kupferbootstrap.git
synced 2025-02-23 05:35:44 -05:00
net: make new module from {forwarding,ssh,telnet}.py
This commit is contained in:
parent
6fed749488
commit
afca099ede
9 changed files with 16 additions and 12 deletions
|
@ -15,8 +15,6 @@ only used to trigger builds of the submodule docs!
|
|||
devices
|
||||
flash
|
||||
flavours
|
||||
forwarding
|
||||
image
|
||||
net
|
||||
packages
|
||||
ssh
|
||||
telnet
|
||||
|
|
2
image.py
2
image.py
|
@ -18,7 +18,7 @@ from exec.file import root_write_file, root_makedir, makedir
|
|||
from packages.build import build_enable_qemu_binfmt, build_packages, filter_pkgbuilds
|
||||
from devices.device import Device, get_profile_device
|
||||
from flavours.flavour import Flavour, get_profile_flavour
|
||||
from ssh import copy_ssh_keys
|
||||
from net.ssh import copy_ssh_keys
|
||||
from wrapper import enforce_wrap
|
||||
|
||||
# image files need to be slightly smaller than partitions to fit
|
||||
|
|
8
main.py
8
main.py
|
@ -9,17 +9,15 @@ from typing import Optional
|
|||
from logger import logging, setup_logging, verbose_option
|
||||
from wrapper import nowrapper_option, enforce_wrap
|
||||
from config.cli import config, config_option, cmd_config
|
||||
from forwarding import cmd_forwarding
|
||||
from packages.cli import cmd_packages
|
||||
from flavours.cli import cmd_flavours
|
||||
from devices.cli import cmd_devices
|
||||
from telnet import cmd_telnet
|
||||
from net.cli import cmd_net
|
||||
from chroot.cli import cmd_chroot
|
||||
from cache import cmd_cache
|
||||
from image import cmd_image
|
||||
from boot import cmd_boot
|
||||
from flash import cmd_flash
|
||||
from ssh import cmd_ssh
|
||||
|
||||
|
||||
@click.group()
|
||||
|
@ -68,11 +66,9 @@ cli.add_command(cmd_config)
|
|||
cli.add_command(cmd_devices)
|
||||
cli.add_command(cmd_flash)
|
||||
cli.add_command(cmd_flavours)
|
||||
cli.add_command(cmd_forwarding)
|
||||
cli.add_command(cmd_image)
|
||||
cli.add_command(cmd_net)
|
||||
cli.add_command(cmd_packages)
|
||||
cli.add_command(cmd_ssh)
|
||||
cli.add_command(cmd_telnet)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
0
net/__init__.py
Normal file
0
net/__init__.py
Normal file
9
net/cli.py
Normal file
9
net/cli.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import click
|
||||
|
||||
from .forwarding import cmd_forwarding
|
||||
from .ssh import cmd_ssh
|
||||
from .telnet import cmd_telnet
|
||||
|
||||
cmd_net = click.Group('net', help='Network utilities like ssh and telnet')
|
||||
for cmd in cmd_forwarding, cmd_ssh, cmd_telnet:
|
||||
cmd_net.add_command(cmd)
|
|
@ -2,9 +2,10 @@ import click
|
|||
import logging
|
||||
|
||||
from exec.cmd import run_root_cmd
|
||||
from ssh import run_ssh_command
|
||||
from wrapper import check_programs_wrap
|
||||
|
||||
from .ssh import run_ssh_command
|
||||
|
||||
|
||||
@click.command(name='forwarding')
|
||||
def cmd_forwarding():
|
|
@ -11,7 +11,7 @@ from exec.file import remove_file
|
|||
from devices.device import get_profile_device
|
||||
from distro.distro import get_kupfer_local
|
||||
from distro.package import LocalPackage
|
||||
from ssh import run_ssh_command, scp_put_files
|
||||
from net.ssh import run_ssh_command, scp_put_files
|
||||
from utils import git
|
||||
from wrapper import check_programs_wrap, enforce_wrap
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue