IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Sfoglia il codice sorgente

Added focker image list.

tags/0.92
parent
commit
48b6f1f872
2 ha cambiato i file con 16 aggiunte e 1 eliminazioni
  1. +6
    -1
      focker.py
  2. +10
    -0
      image.py

+ 6
- 1
focker.py Vedi File

@@ -3,7 +3,8 @@ import yaml
import os
# from weir import zfs, process
from .image import command_image_build, \
command_image_untag
command_image_untag, \
command_image_list
import sys
from .zfs import zfs_init
from .jail import command_jail_run
@@ -23,6 +24,10 @@ def create_parser():
parser.set_defaults(func=command_image_untag)
parser.add_argument('tags', type=str, nargs='+', default=[])
parser = subparsers.add_parser('list')
parser.set_defaults(func=command_image_list)
parser.add_argument('--full-sha256', '-f', action='store_true')
subparsers = subparsers_top.add_parser('jail').add_subparsers()
parser = subparsers.add_parser('run')
parser.set_defaults(func=command_jail_run)


+ 10
- 0
image.py Vedi File

@@ -3,6 +3,7 @@ import os
import yaml
from .steps import create_step
from .snapshot import new_snapshot
from tabulate import tabulate
def process_step(step, name):
@@ -78,3 +79,12 @@ def command_image_build(args):
def command_image_untag(args):
zfs_untag(args.tags)
def command_image_list(args):
lst = zfs_parse_output(['zfs', 'list', '-o', 'name,refer,focker:sha256,focker:tags,origin', '-H'])
lst = list(filter(lambda a: a[2] != '-', lst))
lst = list(map(lambda a: [ a[3], a[1],
a[2] if args.full_sha256 else a[2][:7],
a[4].split('/')[-1].split('@')[0] ], lst))
print(tabulate(lst, headers=['Tags', 'Size', 'SHA256', 'Base']))

Loading…
Annulla
Salva