{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/30277","labels_url":"https://api.github.com/repos/saltstack/salt/issues/30277/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/30277/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/30277/events","html_url":"https://github.com/saltstack/salt/issues/30277","id":126019579,"number":30277,"title":"[salt-cloud] Error actioning machines: 'ascii' codec can't encode character u'\\xa0' in position 20","user":{"login":"webtrekker","id":16315633,"avatar_url":"https://avatars.githubusercontent.com/u/16315633?v=3","gravatar_id":"","url":"https://api.github.com/users/webtrekker","html_url":"https://github.com/webtrekker","followers_url":"https://api.github.com/users/webtrekker/followers","following_url":"https://api.github.com/users/webtrekker/following{/other_user}","gists_url":"https://api.github.com/users/webtrekker/gists{/gist_id}","starred_url":"https://api.github.com/users/webtrekker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webtrekker/subscriptions","organizations_url":"https://api.github.com/users/webtrekker/orgs","repos_url":"https://api.github.com/users/webtrekker/repos","events_url":"https://api.github.com/users/webtrekker/events{/privacy}","received_events_url":"https://api.github.com/users/webtrekker/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/saltstack/salt/labels/High%20Severity","name":"High Severity","color":"ff9143"},{"url":"https://api.github.com/repos/saltstack/salt/labels/P3","name":"P3","color":"0a3d77"},{"url":"https://api.github.com/repos/saltstack/salt/labels/RIoT","name":"RIoT","color":"fef2c0"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Salt-Cloud","name":"Salt-Cloud","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/13","html_url":"https://github.com/saltstack/salt/milestones/Approved","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/13/labels","id":9265,"number":13,"title":"Approved","description":"All issues that are ready to be worked on, both bugs and features.","creator":{"login":"thatch45","id":507599,"avatar_url":"https://avatars.githubusercontent.com/u/507599?v=3","gravatar_id":"","url":"https://api.github.com/users/thatch45","html_url":"https://github.com/thatch45","followers_url":"https://api.github.com/users/thatch45/followers","following_url":"https://api.github.com/users/thatch45/following{/other_user}","gists_url":"https://api.github.com/users/thatch45/gists{/gist_id}","starred_url":"https://api.github.com/users/thatch45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatch45/subscriptions","organizations_url":"https://api.github.com/users/thatch45/orgs","repos_url":"https://api.github.com/users/thatch45/repos","events_url":"https://api.github.com/users/thatch45/events{/privacy}","received_events_url":"https://api.github.com/users/thatch45/received_events","type":"User","site_admin":false},"open_issues":2788,"closed_issues":3222,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2016-01-14T17:40:37Z","due_on":null,"closed_at":null},"comments":39,"created_at":"2016-01-11T19:34:30Z","updated_at":"2016-01-14T17:48:53Z","closed_at":null,"body":"When trying to create a VMWare snapshot using --- \r\n`salt-cloud -a create_snapshot syslog01 snapshot_name=\"mySaltSnap\" description=\"Snap created via Saltcloud\"`\r\n\r\nI get the error --\r\n`UnicodeEncodeError: 'ascii' codec can't encode character u'\\xa0' in position 20: ordinal not in range(128)`\r\n\r\n… in my massive Google’ing this I came across this link\r\nhttp://stackoverflow.com/questions/28544686/unicodeencodeerror-ascii-codec-cant-encode-characters-in-position-0-5-ordin\r\n\r\nSo, from another suggestion that it might be pyVmomi I found this –\r\n    `/usr/lib/python2.7/site-packages/pyVmomi/__init__.py`\r\n \r\nAnd added these two lines after line 20 …\r\n \r\nline 20: `reload(sys)`\r\nAdded: `sys.set`\r\nAdded: `defaultencoding('utf-8')`\r\n\r\n`sed -n '20,23p' /usr/lib/python2.7/site-packages/pyVmomi/__init__.py`\r\n`import sys`\r\n`reload(sys)`\r\n`sys.setdefaultencoding('utf-8')`\r\n\r\nGuess what … IT WORKED !!\r\n \r\nOn my SLES12 Salt-master:\r\nsalt --version\r\nsalt 2015.8.3 (Beryllium)\r\nsalt-cloud --version\r\nsalt-cloud 2015.8.3 (Beryllium)\r\nNote: my SLES12 Salt-master failed when trying to run `salt --versions-report` \r\n\r\nAdding these lines also worked on my RHEL6.5 Salt-master\r\n`sed -n '20,23p' /usr/lib/python2.6/site-packages/pyVmomi/__init__.py`\r\n`import sys`\r\n`reload(sys)`\r\n`sys.setdefaultencoding('utf-8')`\r\n\r\nsalt --versions-report\r\nSalt Version:\r\n           Salt: 2015.8.1\r\n\r\nDependency Versions:\r\n         Jinja2: 2.2.1\r\n       M2Crypto: 0.20.2\r\n           Mako: Not Installed\r\n         PyYAML: 3.11\r\n          PyZMQ: 14.5.0\r\n         Python: 2.6.6 (r266:84292, May 22 2015, 08:34:51)\r\n           RAET: Not Installed\r\n        Tornado: 4.2.1\r\n            ZMQ: 4.0.5\r\n           cffi: Not Installed\r\n       cherrypy: 3.2.2\r\n       dateutil: 1.4.1\r\n          gitdb: Not Installed\r\n      gitpython: Not Installed\r\n          ioflo: Not Installed\r\n        libnacl: Not Installed\r\n   msgpack-pure: Not Installed\r\n msgpack-python: 0.4.6\r\n   mysql-python: Not Installed\r\n      pycparser: Not Installed\r\n       pycrypto: 2.6.1\r\n         pygit2: 0.20.3\r\n   python-gnupg: Not Installed\r\n          smmap: Not Installed\r\n        timelib: Not Installed\r\n\r\nSystem Versions:\r\n           dist: redhat 6.6 Santiago\r\n        machine: x86_64\r\n        release: 2.6.32-504.8.1.el6.x86_64\r\n         system: Red Hat Enterprise Linux Server 6.6 Santiago\r\n\r\nsalt-cloud --version\r\n            salt-cloud 2015.8.1 (Beryllium)\r\n\r\nHowever, the above link suggests that what I added is a \"nasty, nasty hack for people who don't understand encoding\", which would be true of me, but maybe someone from the pyVmomi team or salt-cloud team can find a better work fix.\r\n"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/171720640","html_url":"https://github.com/saltstack/salt/issues/30277#issuecomment-171720640","issue_url":"https://api.github.com/repos/saltstack/salt/issues/30277","id":171720640,"user":{"login":"rallytime","id":6547906,"avatar_url":"https://avatars.githubusercontent.com/u/6547906?v=3","gravatar_id":"","url":"https://api.github.com/users/rallytime","html_url":"https://github.com/rallytime","followers_url":"https://api.github.com/users/rallytime/followers","following_url":"https://api.github.com/users/rallytime/following{/other_user}","gists_url":"https://api.github.com/users/rallytime/gists{/gist_id}","starred_url":"https://api.github.com/users/rallytime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rallytime/subscriptions","organizations_url":"https://api.github.com/users/rallytime/orgs","repos_url":"https://api.github.com/users/rallytime/repos","events_url":"https://api.github.com/users/rallytime/events{/privacy}","received_events_url":"https://api.github.com/users/rallytime/received_events","type":"User","site_admin":false},"created_at":"2016-01-14T17:48:52Z","updated_at":"2016-01-14T17:48:52Z","body":"@webtrekker Yeah that should be fine. I'll be sure to take care of this as @s0undt3ch suggests above for the next version. Thanks for your testing! It is much appreciated."}}