import logging
log = logging.getLogger(__name__)


def lsscsi():
    '''
    List scsi devices
    CLI Example:
    .. code-block:: bash
    salt '*' scsi.lsscsi
    '''
    cmd = 'lsscsi'
    return __salt__['cmd.run'](cmd).splitlines()


def rescan_all(host):
    '''
    List scsi devices
    CLI Example:
    .. code-block:: bash
    salt '*' scsi.rescan_all(0)
    '''
    if os.path.isdir("/sys/class/scsi_host/host{0}").format(host):
        cmd = 'echo "- - -" > /sys/class/scsi_host/host{0}/scan'.format(host)
    else:
        return 'Host {0} does not exist'.format(host)
    return __salt__['cmd.run'](cmd).splitlines()

'''
SCSI administration module
'''

import os.path
import logging

log = logging.getLogger(__name__)


def lsscsi():
    '''
    List SCSI devices

    CLI Example:

    .. code-block:: bash

        salt '*' scsi.lsscsi
    '''
    cmd = 'lsscsi'
    return __salt__['cmd.run'](cmd).splitlines()


def rescan_all(host):
    '''
    List scsi devices

    CLI Example:

    .. code-block:: bash

        salt '*' scsi.rescan_all(0)
    '''
    if os.path.isdir('/sys/class/scsi_host/host{0}').format(host):
        cmd = 'echo "- - -" > /sys/class/scsi_host/host{0}/scan'.format(host)
    else:
        return 'Host {0} does not exist'.format(host)
    return __salt__['cmd.run'](cmd).splitlines()

Update formatting to Salt guidelines
Update formatting to Salt guidelines

+ '''
+ SCSI administration module
+ '''
+ 
+ import os.path
  import logging
+ 
  log = logging.getLogger(__name__)
  
  
  def lsscsi():
      '''
-     List scsi devices
+     List SCSI devices
+ 
      CLI Example:
+ 
      .. code-block:: bash
+ 
-     salt '*' scsi.lsscsi
+         salt '*' scsi.lsscsi
      '''
      cmd = 'lsscsi'
      return __salt__['cmd.run'](cmd).splitlines()
  
  
  def rescan_all(host):
      '''
      List scsi devices
+ 
      CLI Example:
+ 
      .. code-block:: bash
+ 
-     salt '*' scsi.rescan_all(0)
+         salt '*' scsi.rescan_all(0)
      '''
-     if os.path.isdir("/sys/class/scsi_host/host{0}").format(host):
+     if os.path.isdir('/sys/class/scsi_host/host{0}').format(host):
          cmd = 'echo "- - -" > /sys/class/scsi_host/host{0}/scan'.format(host)
      else:
          return 'Host {0} does not exist'.format(host)
      return __salt__['cmd.run'](cmd).splitlines()
  
Update formatting to Salt guidelines
## Code Before:
import logging
log = logging.getLogger(__name__)


def lsscsi():
    '''
    List scsi devices
    CLI Example:
    .. code-block:: bash
    salt '*' scsi.lsscsi
    '''
    cmd = 'lsscsi'
    return __salt__['cmd.run'](cmd).splitlines()


def rescan_all(host):
    '''
    List scsi devices
    CLI Example:
    .. code-block:: bash
    salt '*' scsi.rescan_all(0)
    '''
    if os.path.isdir("/sys/class/scsi_host/host{0}").format(host):
        cmd = 'echo "- - -" > /sys/class/scsi_host/host{0}/scan'.format(host)
    else:
        return 'Host {0} does not exist'.format(host)
    return __salt__['cmd.run'](cmd).splitlines()

## Instruction:
Update formatting to Salt guidelines
## Code After:
'''
SCSI administration module
'''

import os.path
import logging

log = logging.getLogger(__name__)


def lsscsi():
    '''
    List SCSI devices

    CLI Example:

    .. code-block:: bash

        salt '*' scsi.lsscsi
    '''
    cmd = 'lsscsi'
    return __salt__['cmd.run'](cmd).splitlines()


def rescan_all(host):
    '''
    List scsi devices

    CLI Example:

    .. code-block:: bash

        salt '*' scsi.rescan_all(0)
    '''
    if os.path.isdir('/sys/class/scsi_host/host{0}').format(host):
        cmd = 'echo "- - -" > /sys/class/scsi_host/host{0}/scan'.format(host)
    else:
        return 'Host {0} does not exist'.format(host)
    return __salt__['cmd.run'](cmd).splitlines()
