# -*- coding: utf-8 -*-
#  _  __  
# | |/ /___ ___ _ __  ___ _ _ ®
# | ' </ -_) -_) '_ \/ -_) '_|
# |_|\_\___\___| .__/\___|_|
#              |_|            
#
# <NAME> 
# Copyright 2015 Keeper Security Inc.
# Contact: <EMAIL>
#

import logging
import subprocess
import re


def rotate(record, newpassword):
    """ Grab any required fields from the record """

    i = subprocess.call(["net", "user", record.login, newpassword], shell=True)

    if i == 0:
        logging.info('Password changed successfully')
        record.password = <PASSWORD>
        return True

    logging.error('Password change failed')
    return True


def adjust(newpassword):
    # the characters below mess with windows command line
    return re.sub('[<>&|]', '', newpassword)

# -*- coding: utf-8 -*-
#  _  __  
# | |/ /___ ___ _ __  ___ _ _ ®
# | ' </ -_) -_) '_ \/ -_) '_|
# |_|\_\___\___| .__/\___|_|
#              |_|            
#
# <NAME> 
# Copyright 2015 Keeper Security Inc.
# Contact: <EMAIL>
#

import logging
import subprocess
import re


def rotate(record, newpassword):
    """ Grab any required fields from the record """

    i = subprocess.call(["net", "user", record.login, newpassword], shell=True)

    if i == 0:
        logging.info('Password changed successfully')
        record.password = <PASSWORD>
        return True

    logging.error('Password change failed')
    return True


def adjust(newpassword):
    # the characters below mess with windows command line
    return re.sub('[<>&|]', '', newpassword)

# -*- coding: utf-8 -*- #  _  __ # | |/ /___ ___ _ __  ___ _ _ ® # | ' </ -_) -_) '_ \/ -_) '_| # |_|\_\___\___| .__/\___|_| #              |_| # # <NAME> # Copyright 2015 Keeper Security Inc. # Contact: <EMAIL> # Grab any required fields from the record # the characters below mess with windows command line