Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CA-210336: Added exception handling to prevent stack trace dump #331

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

letsboogey
Copy link
Contributor

@letsboogey letsboogey commented Aug 12, 2016

Added exception handling for when devices path is not valid.

Signed-off-by: Letsibogo Ramadi letsibogo.ramadi@citrix.com

devs_path = "/dev/disk/by-scsid/%s" % self.dconf['SCSIid']
devs = os.listdir(devs_path)
except:
util.SMlog("[Errno 2] No such file or directory: '%s'" % devs_path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens after the exception is handled here, the code blindly continues which is probably not what we want here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarkSymsCtx I have raised a XenError exception and the most accurate error code I could find for this exception is the one I pasted below. Does that look right?
<code> <name>ConfigDeviceInvalid</name> <description>The device is not a valid path</description> <value>91</value> </code>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks fine

@letsboogey letsboogey force-pushed the CA-210336 branch 2 times, most recently from 5df738f to 5c1552f Compare August 16, 2016 09:45
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 5c1552f on letsboogey:CA-210336 into * on xapi-project:master*.

Added exception handling for when devices path is not valid.

Signed-off-by: Letsibogo Ramadi <letsibogo.ramadi@citrix.com>
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 841e50f on letsboogey:CA-210336 into * on xapi-project:master*.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants