FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 10-27-2010, 10:51 AM
Ales Kozumplik
 
Default iscsi, logging: reuse the global ISCSID in has_iscsi().

This prevents calling find_program_in_path() repeatedly and having the log
message "ISCSID is /sbin/iscsid" all over the place.
---
pyanaconda/storage/iscsi.py | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/pyanaconda/storage/iscsi.py b/pyanaconda/storage/iscsi.py
index a29fc36..26fa5b5 100644
--- a/pyanaconda/storage/iscsi.py
+++ b/pyanaconda/storage/iscsi.py
@@ -45,19 +45,18 @@ INITIATOR_FILE="/etc/iscsi/initiatorname.iscsi"

def has_iscsi():
global ISCSID
- location = iutil.find_program_in_path("iscsid")
- if location:
- ISCSID = location
-
- if ISCSID == "" or not has_libiscsi:
- return False
-
- log.info("ISCSID is %s" % (ISCSID,))
-
- # make sure the module is loaded
- if not os.access("/sys/module/iscsi_tcp", os.X_OK):
- return False
- return True
+
+ if os.access("/sys/module/iscsi_tcp", os.X_OK):
+ if len(ISCSID):
+ return True
+ else:
+ location = iutil.find_program_in_path("iscsid")
+ if location:
+ ISCSID = location
+ log.info("ISCSID is %s" % (ISCSID,))
+ return True
+
+ return False

def randomIname():
"""Generate a random initiator name the same way as iscsi-iname"""
--
1.7.1.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 10-29-2010, 10:51 AM
Ales Kozumplik
 
Default iscsi, logging: reuse the global ISCSID in has_iscsi().

This prevents calling find_program_in_path() repeatedly and having the log
message "ISCSID is /sbin/iscsid" all over the place.
---
pyanaconda/storage/iscsi.py | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/pyanaconda/storage/iscsi.py b/pyanaconda/storage/iscsi.py
index a29fc36..3bd953b 100644
--- a/pyanaconda/storage/iscsi.py
+++ b/pyanaconda/storage/iscsi.py
@@ -45,18 +45,17 @@ INITIATOR_FILE="/etc/iscsi/initiatorname.iscsi"

def has_iscsi():
global ISCSID
- location = iutil.find_program_in_path("iscsid")
- if location:
- ISCSID = location
-
- if ISCSID == "" or not has_libiscsi:
+
+ if not os.access("/sys/module/iscsi_tcp", os.X_OK):
return False

- log.info("ISCSID is %s" % (ISCSID,))
+ if not ISCSID:
+ location = iutil.find_program_in_path("iscsid")
+ if not location:
+ return False
+ ISCSID = location
+ log.info("ISCSID is %s" % (ISCSID,))

- # make sure the module is loaded
- if not os.access("/sys/module/iscsi_tcp", os.X_OK):
- return False
return True

def randomIname():
--
1.7.1.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 11-01-2010, 02:30 PM
Chris Lumens
 
Default iscsi, logging: reuse the global ISCSID in has_iscsi().

> This prevents calling find_program_in_path() repeatedly and having the log
> message "ISCSID is /sbin/iscsid" all over the place.

ACK to this one.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 07:33 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org