dalgibbard / citrix_xenserver_patcher

Auto / Manual Patching tool for Citrix XenServer Boxes
Do What The F*ck You Want To Public License
142 stars 45 forks source link

urllib2 #5

Closed TheInvisibleMan closed 10 years ago

TheInvisibleMan commented 10 years ago

Performed the wget performed the chmod ran the patcher program and got :

Traceback (most recent call last): File "./patcher.py", line 231, in ? except (urllib2.HTTPError, urllib2.URLError): NameError: name 'urllib2' is not defined

dalgibbard commented 10 years ago

That's quite odd...

Could you provide me with the following please?

md5sum patcher.py
python -V
python -m urllib2
python -m urllib
file patcher.py

Thanks in advance!

dalgibbard commented 10 years ago

Just to provide some actual feedback too, it sounds to me as though the very first section of code that imports the urllib/urlib2 urlopen module isn't being run.

I don't expect it to be an import error, as that would have thrown an exception much earlier... It's possible that odd formatting from the download may have caused issues here, but difficult to say at first glance.

TheInvisibleMan commented 10 years ago

login as: root root@rr-xenserver1's password: Last login: Tue Dec 10 20:42:55 2013 from jupiter.rr.local

XenServer dom0 configuration is tuned for maximum performance and reliability.

Configuration changes which are not explicitly documented or approved by Citrix Technical Support, may not have been tested and are therefore not supported. In addition, configuration changes may not persist after installation of a hotfix or upgrade, and could also cause a hotfix or upgrade to fail.

Third party tools, which require modification to dom0 configuration, or installation into dom0, may cease to function correctly after upgrade or hotfix installation. Please consult Citrix Technical Support for advice regarding specific tools.

Type "xsconsole" for access to the management console. [root@rr-xenserver1 ~]# md5sum patcher.py 40bea04d544765d549d406748cbbdb67 patcher.py [root@rr-xenserver1 ~]# python -V Python 2.4.3 [root@rr-xenserver1 ~]# python -m urllib2 [root@rr-xenserver1 ~]# python -m urllib Use -h for help [root@rr-xenserver1 ~]# file patcher.py patcher.py: python script text executable

From: Darren Gibbard [mailto:notifications@github.com] Sent: December 11, 2013 1:27 AM To: dalgibbard/citrix_xenserver_patcher Cc: Paul Nobert Subject: Re: [citrix_xenserver_patcher] urllib2 (#5)

That's quite odd...

Could you provide me with the following please?

md5sum patcher.py

python -V

python -m urllib2

python -m urllib

file patcher.py

Thanks in advance!

Reply to this email directly or view it on GitHubhttps://github.com/dalgibbard/citrix_xenserver_patcher/issues/5#issuecomment-30297709.


My Dropbox Attachments


dalgibbard commented 10 years ago

That's really odd! Compared that md5sum against a machine I have in production with a working patcher.py:

# md5sum patcher.py 
40bea04d544765d549d406748cbbdb67  patcher.py

Could you advise on which XenServer version you're running please?:

cat /etc/redhat-release

Then once i have that, i'll run a clean test install and report back. Thanks for your patience!

dalgibbard commented 10 years ago

Oh wait a second! Think i've figured it out. Doh!

I managed to trigger it by changing the "patchxmlurl" to be something which doesn't exist (thereby generating a 404 error.) Have fixed and committed a change to correctly capture these errors; so they now display like:

Failed to read Citrix Patch List from: http://updates.xensource.com/XenServer/updatescheese.xml
Check the URL is available, and connectivity is OK.

Error: HTTP Error 404: Not Found

Much better. Would you like to re-download and test?

dalgibbard commented 10 years ago

Should be fixed in commit 05a4ab2c56a112f36d2558750f97cffec4273ea7

TheInvisibleMan commented 10 years ago

It is better, but not all good yet !!

./patcher.py

Failed to read Citrix Patch List from: http://updates.xensource.com/XenServer/updates.xml Check the URL is available, and connectivity is OK.

Error: <urlopen error (110, 'Connection timed out')>

I am running behind a corporate firewall. I will check when connected directly outside

dalgibbard commented 10 years ago

Odd that it's refusing to give an error! I'd be interested to know what error you get if you try and wget that XML file instead?

It is most likely a firewall issue; but I'd still like the code to be a little more polite about it! :)

Thanks for the feedback though- I'll keep this open for now in case you have any more information.

TheInvisibleMan commented 10 years ago

It is working now. Awesome! I did get an 110 connection lost after the patch installation but i guess i simply have to run again

dalgibbard commented 10 years ago

Jolly good :)

I'll get this closed off then.

Thanks for your help and feedback!