fabtools.pkg¶
SmartOS packages¶
This module provides tools to manage SmartOS packages.
See also
- fabtools.pkg.install(packages, update=False, yes=None, options=None)[source]¶
Install one or more packages.
If update is True, the package definitions will be updated first, using update_index().
Extra yes may be passed to pkgin to validate license if necessary.
Extra options may be passed to pkgin if necessary.
Example:
import fabtools # Update index, then verbosely install a single package fabtools.pkg.install('redis', update=True, options='-V',) # Install multiple packages fabtools.pkg.install([ 'unzip', 'top' ])
- fabtools.pkg.uninstall(packages, orphan=False, options=None)[source]¶
Remove one or more packages.
If orphan is True, orphan dependencies will be removed from the system.
Extra options may be passed to pkgin if necessary.
- fabtools.pkg.smartos_build()[source]¶
Get the build of SmartOS. Useful to determine provider for example.
Example:
from fabtools.pkg import smartos_build if smartos_build().startswith('joyent'): print('SmartOS Joyent')
- fabtools.pkg.smartos_image()[source]¶
Get the SmartOS image. Useful to determine the image/dataset for example. Returns None if it can’t be determined.
Example:
from fabtools.pkg import smartos_image if smartos_image().startswith('percona'): sudo("mysql -uroot -psecretpassword -e 'show databases;'")