Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

#! /usr/bin/env python 

# 

# Copyright (C) Citrix Systems Inc. 

# 

# This program is free software; you can redistribute it and/or modify  

# it under the terms of the GNU Lesser General Public License as published  

# by the Free Software Foundation; version 2.1 only. 

# 

# This program is distributed in the hope that it will be useful,  

# but WITHOUT ANY WARRANTY; without even the implied warranty of  

# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  

# GNU Lesser General Public License for more details. 

# 

# You should have received a copy of the GNU Lesser General Public License 

# along with this program; if not, write to the Free Software Foundation, Inc., 

# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA 

 

import sys, os 

import glob 

import util 

 

DEVBYMPPPATH = "/dev/disk/by-mpp" 

def is_RdacLun(scsi_id): 

    path = os.path.join(DEVBYMPPPATH,"%s" % scsi_id) 

    mpppath = glob.glob(path) 

    if len(mpppath): 

        # Support for RDAC LUNs discontinued 

        # Always return False 

        util.SMlog("Found unsupported RDAC LUN at %s" % mpppath, 

                   priority=util.LOG_WARNING) 

        return False 

    else: 

        return False 

 

def usage(): 

    print "Usage:"; 

    print "%s is_rdaclun <scsi_id>" % sys.argv[0] 

 

def main(): 

    if len(sys.argv) < 3: 

        usage() 

        sys.exit(-1) 

 

    scsi_id = sys.argv[2] 

    mode = sys.argv[1] 

 

    if mode == "is_rdaclun": 

        if (is_RdacLun(scsi_id)): 

            print "It is a RDAC Lun" 

            return True 

        else: 

            print "It is not a RDAC Lun" 

            return False 

    else: 

        usage() 

        sys.exit(-1) 

58if __name__ == "__main__": 

    main()