forked from ungleich-public/cdist
also move out install and cleanup library path code
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
35e33570d1
commit
27b4b9cd03
2 changed files with 36 additions and 10 deletions
16
bin/cdist
16
bin/cdist
|
@ -33,17 +33,13 @@ import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
real_me = os.path.dirname(os.path.realpath(__file__))
|
|
||||||
cdist_lib = os.path.abspath(os.path.join(real_me, '../lib'))
|
|
||||||
|
|
||||||
sys.path.insert(0, cdist_lib)
|
# Ensure our /lib/ is included into PYTHON_PATH
|
||||||
|
sys.path.insert(0, os.path.abspath(
|
||||||
|
os.path.join(os.path.dirname(os.path.realpath(__file__)), '../lib'))
|
||||||
|
)
|
||||||
|
|
||||||
TYPE_PREFIX = "__"
|
TYPE_PREFIX = "__"
|
||||||
CODE_HEADER = "#!/bin/sh -e\n"
|
|
||||||
|
|
||||||
def install(args):
|
|
||||||
"""Install remote system"""
|
|
||||||
process = {}
|
|
||||||
|
|
||||||
def commandline():
|
def commandline():
|
||||||
"""Parse command line"""
|
"""Parse command line"""
|
||||||
|
@ -91,7 +87,7 @@ def commandline():
|
||||||
# Install
|
# Install
|
||||||
parser['install'] = parser['sub'].add_parser('install',
|
parser['install'] = parser['sub'].add_parser('install',
|
||||||
parents=[parser['most'], parser['configinstall']])
|
parents=[parser['most'], parser['configinstall']])
|
||||||
parser['install'].set_defaults(func=install)
|
parser['install'].set_defaults(func=cdist.install.install)
|
||||||
|
|
||||||
for p in parser:
|
for p in parser:
|
||||||
parser[p].epilog = "Get cdist at http://www.nico.schottelius.org/software/cdist/"
|
parser[p].epilog = "Get cdist at http://www.nico.schottelius.org/software/cdist/"
|
||||||
|
@ -106,7 +102,6 @@ def commandline():
|
||||||
|
|
||||||
args.func(args)
|
args.func(args)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
try:
|
try:
|
||||||
logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s')
|
logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s')
|
||||||
|
@ -119,6 +114,7 @@ if __name__ == "__main__":
|
||||||
import cdist.banner
|
import cdist.banner
|
||||||
import cdist.config
|
import cdist.config
|
||||||
import cdist.exec
|
import cdist.exec
|
||||||
|
import cdist.install
|
||||||
import cdist.path
|
import cdist.path
|
||||||
|
|
||||||
commandline()
|
commandline()
|
||||||
|
|
30
lib/cdist/install.py
Executable file
30
lib/cdist/install.py
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org)
|
||||||
|
#
|
||||||
|
# This file is part of cdist.
|
||||||
|
#
|
||||||
|
# cdist is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# cdist is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
def install(args):
|
||||||
|
"""Install remote system"""
|
||||||
|
process = {}
|
||||||
|
|
Loading…
Reference in a new issue