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

removing remaining Python2+3 crumbs #354

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion capirca/lib/aclgenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import string

from capirca.lib import policy
import six
import hashlib

# generic error class
Expand Down
1 change: 0 additions & 1 deletion capirca/lib/arista_tp.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

from absl import logging
from capirca.lib import aclgenerator
import six

# 1 2 3
# 123456789012345678901234567890123456789
Expand Down
4 changes: 1 addition & 3 deletions capirca/lib/cloudarmor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

from capirca.lib import aclgenerator

import six


# Generic error class
class Error(Exception):
Expand Down Expand Up @@ -253,6 +251,6 @@ def __str__(self):

out = '%s\n\n' % (
json.dumps(self.cloudarmor_policies, indent=2,
separators=(six.ensure_str(','), six.ensure_str(': ')),
separators=(',', ': '),
sort_keys=True))
return out
6 changes: 2 additions & 4 deletions capirca/lib/gce.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

from capirca.lib import gcp
from capirca.lib import nacaddr
import six


class Error(Exception):
Expand Down Expand Up @@ -159,7 +158,7 @@ def __init__(self, term, inet_version='inet', policy_inet_version='inet'):
def __str__(self):
"""Convert term to a string."""
json.dumps(self.ConvertToDict(), indent=2,
separators=(six.ensure_str(','), six.ensure_str(': ')))
separators=(',', ': '))

def _validateDirection(self):
if self.term.direction == 'INGRESS':
Expand Down Expand Up @@ -582,8 +581,7 @@ def _TranslatePolicy(self, pol, exp_info):

def __str__(self):
out = '%s\n\n' % (json.dumps(self.gce_policies, indent=2,
separators=(six.ensure_str(','),
six.ensure_str(': ')),
separators=(',', ': '),
sort_keys=True))

return out
Expand Down
5 changes: 2 additions & 3 deletions capirca/lib/gce_vpc_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

from capirca.lib import gcp
from capirca.lib import nacaddr
import six


class Error(Exception):
Expand Down Expand Up @@ -158,7 +157,7 @@ def __str__(self):
json.dumps(
self.ConvertToDict(priority_index=1),
indent=2,
separators=(six.ensure_str(','), six.ensure_str(': ')))
separators=(',', ': '))

def _validateDirection(self):
if self.term.direction == 'INGRESS':
Expand Down Expand Up @@ -610,7 +609,7 @@ def __str__(self):
json.dumps(
self.resource_wrapper,
indent=2,
separators=(six.ensure_str(','), six.ensure_str(': ')),
separators=(',', ': '),
sort_keys=True))
return out

Expand Down
4 changes: 1 addition & 3 deletions capirca/lib/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

from capirca.lib import aclgenerator

import six


class Error(Exception):
"""Generic error class."""
Expand Down Expand Up @@ -68,7 +66,7 @@ def __str__(self):
json.dumps(
self.policies,
indent=2,
separators=(six.ensure_str(','), six.ensure_str(': ')),
separators=(',', ': '),
sort_keys=True))
return out

Expand Down
1 change: 0 additions & 1 deletion capirca/lib/juniper.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from capirca.lib import aclgenerator
from capirca.lib import nacaddr
from capirca.lib import summarizer
import six


# generic error class
Expand Down
1 change: 0 additions & 1 deletion capirca/lib/junipermsmpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from capirca.lib import aclgenerator
from capirca.lib import juniper
from capirca.lib import nacaddr
import six

MAX_IDENTIFIER_LEN = 55 # It is really 63, but leaving room for added chars

Expand Down
1 change: 0 additions & 1 deletion capirca/lib/junipersrx.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from absl import logging
from capirca.lib import aclgenerator
from capirca.lib import nacaddr
import six


ICMP_TERM_LIMIT = 8
Expand Down
3 changes: 1 addition & 2 deletions capirca/lib/nsxv.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from absl import logging
from capirca.lib import aclgenerator
from capirca.lib import nacaddr
import six


_ACTION_TABLE = {
Expand Down Expand Up @@ -624,7 +623,7 @@ def __str__(self):
target.append('-->')

for (_, _, _, terms) in self.nsxv_policies:
section_name = six.ensure_str(self._FILTER_OPTIONS_DICT['section_name'])
section_name = str(self._FILTER_OPTIONS_DICT['section_name'])
# check section id value
section_id = self._FILTER_OPTIONS_DICT['section_id']
if not section_id or section_id == 0:
Expand Down
4 changes: 1 addition & 3 deletions capirca/lib/openconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from capirca.lib import aclgenerator
from capirca.lib import nacaddr
from collections import defaultdict
import six


class Error(Exception):
Expand Down Expand Up @@ -262,8 +261,7 @@ def _TranslatePolicy(self, pol, exp_info):

def __str__(self):
out = '%s\n\n' % (json.dumps(self.oc_policies, indent=2,
separators=(six.ensure_str(','),
six.ensure_str(': ')),
separators=(',', ': '),
sort_keys=True))

return out
1 change: 0 additions & 1 deletion capirca/lib/policy_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"""

from absl import logging
import six


class Field:
Expand Down
1 change: 0 additions & 1 deletion capirca/lib/versa.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from absl import logging
from capirca.lib import aclgenerator
from capirca.lib import nacaddr
#import six



Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
absl-py
ply
PyYAML
six>=1.12.0
typing_extensions
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@
install_requires=[
'absl-py',
'ply',
'mock',
'six',
'PyYAML',
],
python_requires='>=3.6',
Expand Down