Skip to content

Commit

Permalink
feat(packages): the python library is a dedicated component
Browse files Browse the repository at this point in the history
It's actually only useful for generating the servec TLS certificates
from SaltStack.

* libvirt/python/init.sls: include “libvirt.python.install” SLS.

* libvirt/python/install.sls: use “tplroot” to resolve import.
  Install the libvirt python package if any.
  • Loading branch information
baby-gnu committed Aug 28, 2019
1 parent f9e587d commit d07a3ec
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
11 changes: 0 additions & 11 deletions libvirt/python.sls

This file was deleted.

5 changes: 5 additions & 0 deletions libvirt/python/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

include:
- .install
16 changes: 16 additions & 0 deletions libvirt/python/install.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import libvirt_settings with context %}
{%- from tplroot ~ "/python.jinja" import switch_python32 with context %}
{%- set package = switch_python32(libvirt_settings.python3_pkg, libvirt_settings.python2_pkg) %}
{#- Some OS do not have the python3 library #}
{%- if package %}
libvirt-python:
pkg.installed:
- name: {{ package }}
{%- endif %}

0 comments on commit d07a3ec

Please sign in to comment.