corrected ling errors on solarisips.py

This commit is contained in:
YanChii 2014-07-18 17:46:39 +02:00
parent d503071223
commit f07e2eadb2

View File

@ -20,17 +20,13 @@ Or you can set the provider in sls for each pkg:
''' '''
# Import python libs
import os
import sys
from pprint import pprint # for install()
# Import salt libs # Import salt libs
import salt.utils import salt.utils
# Define the module's virtual name # Define the module's virtual name
__virtualname__ = 'solarisips' __virtualname__ = 'solarisips'
def __virtual__(): def __virtual__():
''' '''
Set the virtual pkg module if the os is Solaris 11 Set the virtual pkg module if the os is Solaris 11
@ -39,6 +35,7 @@ def __virtual__():
return __virtualname__ return __virtualname__
return False return False
ips_pkg_return_values = { ips_pkg_return_values = {
0: 'Command succeeded.', 0: 'Command succeeded.',
1: 'An error occurred.', 1: 'An error occurred.',
@ -50,6 +47,7 @@ ips_pkg_return_values = {
7: 'The image is currently in use by another process and cannot be modified.' 7: 'The image is currently in use by another process and cannot be modified.'
} }
def _ips_get_pkgname(line): def _ips_get_pkgname(line):
''' '''
Extracts package name from "pkg list -v" output. Extracts package name from "pkg list -v" output.
@ -61,6 +59,7 @@ def _ips_get_pkgname(line):
''' '''
return line.split()[0].split('@')[0].strip() return line.split()[0].split('@')[0].strip()
def _ips_get_pkgversion(line): def _ips_get_pkgversion(line):
''' '''
Extracts package version from "pkg list -v" output. Extracts package version from "pkg list -v" output.
@ -72,6 +71,7 @@ def _ips_get_pkgversion(line):
''' '''
return line.split()[0].split('@')[1].strip() return line.split()[0].split('@')[1].strip()
def refresh_db(full=False): def refresh_db(full=False):
''' '''
Updates the remote repos database. You can force the full pkg DB refresh from all publishers regardless the last refresh time. Updates the remote repos database. You can force the full pkg DB refresh from all publishers regardless the last refresh time.
@ -86,6 +86,7 @@ def refresh_db(full=False):
else: else:
return __salt__['cmd.retcode']('/bin/pkg refresh') == 0 return __salt__['cmd.retcode']('/bin/pkg refresh') == 0
def upgrade_available(name): def upgrade_available(name):
''' '''
Check if there is an upgrade available for a certain package Check if there is an upgrade available for a certain package
@ -269,6 +270,7 @@ def get_fmri(name, **kwargs):
return ret return ret
def normalize_name(name, **kwargs): def normalize_name(name, **kwargs):
''' '''
Normalizes pkg name to full FMRI before running pkg.install. Normalizes pkg name to full FMRI before running pkg.install.
@ -337,6 +339,7 @@ def search(name, versions_as_list=False, **kwargs):
__salt__['pkg_resource.stringify'](ret) __salt__['pkg_resource.stringify'](ret)
return ret return ret
def install(name=None, refresh=False, pkgs=None, version=None, test=False, **kwargs): def install(name=None, refresh=False, pkgs=None, version=None, test=False, **kwargs):
''' '''
Install the named package using the IPS pkg command. Install the named package using the IPS pkg command.
@ -490,4 +493,3 @@ def purge(name, **kwargs):
salt '*' pkg.purge <package name> salt '*' pkg.purge <package name>
''' '''
return remove(name, **kwargs) return remove(name, **kwargs)