Wrapper around impacket.smbconnection.putFile() that allows a file to be
    uploaded

    Example usage:

        import salt.utils.smb
        smb_conn = salt.utils.smb.get_conn('10.0.0.45', 'vagrant', 'vagrant')
        salt.utils.smb.put_file('/root/test.pdf', 'temp\\myfiles\\test1.pdf', conn=smb_conn)

def put_file(local_path, path, share='C$', conn=None, host=None, username=None, password=None):
    '''
    Wrapper around impacket.smbconnection.putFile() that allows a file to be
    uploaded

    Example usage:

        import salt.utils.smb
        smb_conn = salt.utils.smb.get_conn('10.0.0.45', 'vagrant', 'vagrant')
        salt.utils.smb.put_file('/root/test.pdf', 'temp\\myfiles\\test1.pdf', conn=smb_conn)
    '''
    if HAS_SMBPROTOCOL:
        return _put_file_smbprotocol(
            local_path, path, share, conn=conn, host=host, username=username,
            password=password
        )
    elif HAS_IMPACKET:
        return _put_file_impacket(
            local_path, path, share, conn=conn, host=host, username=username,
            password=password
        )
    raise MissingSmb("SMB library required (impacket or smbprotocol)")