components/docker/files/docker-support
changeset 6525 0acea8dd9c9a
parent 6524 36d593a12044
child 6526 f9817cae9bf4
equal deleted inserted replaced
6524:36d593a12044 6525:0acea8dd9c9a
    42         raise RuntimeError("Unable to determine version: %s" % err)
    42         raise RuntimeError("Unable to determine version: %s" % err)
    43 
    43 
    44 
    44 
    45 def get_os_version():
    45 def get_os_version():
    46     try:
    46     try:
    47         output = DockerSupportCmd(['/usr/bin/pkg', 'info', 'entire']).run()
    47         output = DockerSupportCmd(['/usr/bin/pkg', 'info', '-r',
       
    48             'osnet/osnet-incorporation']).run()
    48         for line in map(str.strip, output.splitlines()):
    49         for line in map(str.strip, output.splitlines()):
    49             if line.startswith("Branch"):
    50             if line.startswith("Branch"):
    50                 return line.split(":")[1].strip()
    51                 return line.split(":")[1].strip()
    51     except Exception as err:
    52     except Exception as err:
    52         raise RuntimeError("Unable to determine version: %s" % err)
    53         raise RuntimeError("Unable to determine version: %s" % err)