Created
November 15, 2011 14:32
-
-
Save Pugio/1367211 to your computer and use it in GitHub Desktop.
Python mount share
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
network_share_available = os.path.isdir(network_share_path) | |
if network_share_available: | |
logger.info("Share already connected.") | |
else: | |
logger.info("Connecting to share") | |
mount_command = "net use " + SHARE_PATH + " " | |
os.system(mount_command) | |
network_share_available = os.path.isdir(network_share_path) | |
if network_share_available: | |
logger.fine("Connection success.") | |
else: | |
raise Exception("Failed to find storage directory.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment