Fixup small things from PR review comments

This commit is contained in:
rallytime 2018-01-22 14:34:19 -05:00
parent ca946886f0
commit ab99c7fbd7
No known key found for this signature in database
GPG Key ID: E8F1A4B90D0DEA19
3 changed files with 3 additions and 9 deletions

View File

@ -16,7 +16,6 @@ Kapacitor execution module.
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
# Import Salt lobs
from salt.ext import six
@ -25,8 +24,6 @@ import salt.utils.json
import salt.utils.path
from salt.utils.decorators import memoize
log = logging.getLogger(__name__)
def __virtual__():
return 'kapacitor' if salt.utils.path.which('kapacitor') else False

View File

@ -417,7 +417,7 @@ def _qemu_image_create(vm_name,
log.debug('Resize qcow2 image to %sM', disk_size)
__salt__['cmd.run'](
'qemu-img resize {0} {1}M'
.format(img_dest, six.text_type(disk_size))
.format(img_dest, disk_size)
)
log.debug('Apply umask and remove exec bit')
@ -440,7 +440,7 @@ def _qemu_image_create(vm_name,
log.debug('Create empty image with size %sM', disk_size)
__salt__['cmd.run'](
'qemu-img create -f {0} {1} {2}M'
.format(disk_type, img_dest, six.text_type(disk_size))
.format(disk_type, img_dest, disk_size)
)
else:
raise CommandExecutionError(
@ -719,7 +719,7 @@ def init(name,
# for the first disk instead of the image from the disk profile
disk_name = next(six.iterkeys(diskp[0]))
log.debug('%s image from module arguments will be used for disk "%s"'
' instead of %s', image, disk_name, diskp[0][disk_name].get('image', None))
' instead of %s', image, disk_name, diskp[0][disk_name].get('image'))
diskp[0][disk_name]['image'] = image
# Create multiple disks, empty or from specified images.

View File

@ -18,13 +18,10 @@ Kapacitor state module.
from __future__ import absolute_import, print_function, unicode_literals
import difflib
import logging
import salt.utils.files
import salt.utils.stringutils
log = logging.getLogger(__name__)
def __virtual__():
return 'kapacitor' if 'kapacitor.version' in __salt__ else False