#!/usr/bin/python
#                             -*- Mode: Python -*- 
# isi_fc_rescan
#
# Author          : Yiyao Wu
# Created On      : Sun Dec 14 21:06:12 2008
# Last Modified By: Yiyao Wu
# Last Modified On: Thu Apr 16 16:27:07 2015
# Update Count    : 1
#
# Copyright (c) 2015
# Isilon System, Inc. All rights reserved.
#

import os.path
import sys
import time
import subprocess

failed = False
errfile = open("/var/log/isi_fc_rescan.log", "w")

p = subprocess.Popen(["isi_rescan_tapes"], stdout=errfile, stderr=errfile)
failed = p.wait() != 0

if not failed:
    errfile.write("isi_fc_rescan ran successfully\n")
    errfile.write("Devices at boot time\n")
    p = subprocess.Popen(["camcontrol", "devlist", "-v"],
        stderr=errfile, stdout=errfile)
