mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
More unicode changes. Adding print_function to all files. Updating various reads & writes to files.
This commit is contained in:
parent
553669f94f
commit
a773ff90e5
@ -17,7 +17,7 @@
|
||||
'''
|
||||
|
||||
# Import Python libs
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals, print_function
|
||||
import logging
|
||||
import xml.dom.minidom
|
||||
|
||||
|
@ -16,7 +16,7 @@ Utils for the NAPALM modules and proxy.
|
||||
'''
|
||||
|
||||
# Import Python libs
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals, print_function
|
||||
import traceback
|
||||
import logging
|
||||
import importlib
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
http://code.activestate.com/recipes/440554/
|
||||
'''
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals, print_function
|
||||
|
||||
# Import python libs
|
||||
import os
|
||||
|
@ -4,7 +4,7 @@ Define some generic socket functions for network modules
|
||||
'''
|
||||
|
||||
# Import python libs
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals, print_function
|
||||
import itertools
|
||||
import os
|
||||
import re
|
||||
@ -1271,6 +1271,7 @@ def active_tcp():
|
||||
if os.path.isfile(statf):
|
||||
with salt.utils.files.fopen(statf, 'rb') as fp_:
|
||||
for line in fp_:
|
||||
line = salt.utils.stringutils.to_unicode(line)
|
||||
if line.strip().startswith('sl'):
|
||||
continue
|
||||
ret.update(_parse_tcp_line(line))
|
||||
@ -1306,6 +1307,7 @@ def _remotes_on(port, which_end):
|
||||
proc_available = True
|
||||
with salt.utils.files.fopen(statf, 'r') as fp_:
|
||||
for line in fp_:
|
||||
line = salt.utils.stringutils.to_unicode(line)
|
||||
if line.strip().startswith('sl'):
|
||||
continue
|
||||
iret = _parse_tcp_line(line)
|
||||
|
@ -21,7 +21,7 @@
|
||||
'''
|
||||
|
||||
# Import python libs
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals, print_function
|
||||
from collections import Callable
|
||||
|
||||
# Import 3rd-party libs
|
||||
|
@ -5,7 +5,7 @@ Neutron class
|
||||
|
||||
|
||||
# Import python libs
|
||||
from __future__ import absolute_import, with_statement, unicode_literals
|
||||
from __future__ import absolute_import, with_statement, unicode_literals, print_function
|
||||
import logging
|
||||
|
||||
# Import third party libs
|
||||
|
@ -4,7 +4,7 @@ Nova class
|
||||
'''
|
||||
|
||||
# Import Python libs
|
||||
from __future__ import absolute_import, with_statement, unicode_literals
|
||||
from __future__ import absolute_import, with_statement, unicode_literals, print_function
|
||||
import inspect
|
||||
import logging
|
||||
import time
|
||||
@ -775,7 +775,7 @@ class SaltNova(object):
|
||||
nt_ks = self.compute_conn
|
||||
if pubfile:
|
||||
with salt.utils.files.fopen(pubfile, 'r') as fp_:
|
||||
pubkey = fp_.read()
|
||||
pubkey = salt.utils.stringutils.to_unicode(fp_.read())
|
||||
if not pubkey:
|
||||
return False
|
||||
nt_ks.keypairs.create(name, public_key=pubkey)
|
||||
|
@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Import Python libs
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals, print_function
|
||||
|
||||
# pylint: disable=import-error
|
||||
try:
|
||||
|
@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals, print_function
|
||||
|
||||
try:
|
||||
import pyrax
|
||||
|
@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals, print_function
|
||||
|
||||
# Import Python libs
|
||||
import logging
|
||||
|
@ -4,7 +4,7 @@ Swift utility class
|
||||
===================
|
||||
Author: Anthony Stanton <anthony.stanton@gmail.com>
|
||||
'''
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals, print_function
|
||||
|
||||
# Import python libs
|
||||
import logging
|
||||
|
@ -21,7 +21,7 @@ Rob Speer's changes are as follows:
|
||||
- added a __getstate__ and __setstate__ so it can be pickled
|
||||
- added __getitem__
|
||||
'''
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals, print_function
|
||||
import collections
|
||||
|
||||
SLICE_ALL = slice(None)
|
||||
|
@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Import Python libs
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals, print_function
|
||||
import logging
|
||||
import socket
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user