This module provides tools to manage SmartOS packages.
See also
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'
])
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.
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')
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;'")