Skip to content

Commit

Permalink
Update nomenclature: 'sswsdk' -> 'swsssdk' (sonic-net#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
jleveque authored Mar 30, 2017
1 parent c0e022a commit d39b66b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## SNMP Subagent

[AgentX](https://www.ietf.org/rfc/rfc2741.txt) implementation for SONiC/SSW. See the [SONiC website](http://azure.github.io/SONiC/) for more information on the SONiC project.
[AgentX](https://www.ietf.org/rfc/rfc2741.txt) implementation for SONiC Switch State Service. See the [SONiC website](http://azure.github.io/SONiC/) for more information on the SONiC project.

MIB implementations included:

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages

dependencies = [
'sswsdk>=2.0.1',
'swsssdk>=2.0.1',
'psutil>=4.0',
'python_arptable>=0.0.1',
]
Expand All @@ -11,7 +11,7 @@
]

high_performance_deps = [
'sswsdk[high_perf]>=2.0.1',
'swsssdk[high_perf]>=2.0.1',
]

setup(
Expand Down
8 changes: 4 additions & 4 deletions src/sonic_ax_impl/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import shutil
import sys

import sswsdk.util
import swsssdk.util

import ax_interface
import sonic_ax_impl
Expand Down Expand Up @@ -34,7 +34,7 @@ def install_fragments():
sys.exit(0)

# import command line arguments
args = sswsdk.util.process_options("sonic_ax_impl")
args = swsssdk.util.process_options("sonic_ax_impl")

# configure logging. If debug '-d' is specified, logs to stdout at designated level. syslog/INFO otherwise.
log_level = log_level_sdk = args.get('log_level')
Expand All @@ -58,11 +58,11 @@ def install_fragments():
# set the log levels
sonic_ax_impl.logger.setLevel(log_level)
ax_interface.logger.setLevel(log_level)
sswsdk.logger.setLevel(log_level_sdk)
swsssdk.logger.setLevel(log_level_sdk)

# inherit logging handlers in submodules
ax_interface.logger.handlers = sonic_ax_impl.logger.handlers
sswsdk.logger.handlers = sonic_ax_impl.logger.handlers
swsssdk.logger.handlers = sonic_ax_impl.logger.handlers

# init mibs module with command line arguments
mibs.config(**args)
Expand Down
4 changes: 2 additions & 2 deletions src/sonic_ax_impl/mibs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pprint
import re

from sswsdk import SonicV2Connector
from swsssdk import SonicV2Connector

from sonic_ax_impl import logger, _if_alias_map

Expand Down Expand Up @@ -57,7 +57,7 @@ def init_sync_d_interface_tables():
:return: tuple(db_conn, if_name_map, if_id_map, oid_map, if_alias_map)
"""
# SyncD database connector. THIS MUST BE INITIALIZED ON A PER-THREAD BASIS.
# Redis PubSub objects (such as those within sswsdk) are NOT thread-safe.
# Redis PubSub objects (such as those within swsssdk) are NOT thread-safe.
db_conn = SonicV2Connector(**redis_kwargs)
db_conn.connect(COUNTERS_DB)

Expand Down
12 changes: 6 additions & 6 deletions tests/mock_tables/dbconnector.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os

import mockredis
import sswsdk.interface
from sswsdk.interface import redis
import swsssdk.interface
from swsssdk.interface import redis


def _subscribe_keyspace_notification(self, db_name, client):
Expand All @@ -17,9 +17,9 @@ def config_set(self, *args):

INPUT_DIR = os.path.dirname(os.path.abspath(__file__))

class SSWSyncClient(mockredis.MockRedis):
class SwssSyncClient(mockredis.MockRedis):
def __init__(self, *args, **kwargs):
super(SSWSyncClient, self).__init__(strict=True, *args, **kwargs)
super(SwssSyncClient, self).__init__(strict=True, *args, **kwargs)
db = kwargs.pop('db')
if db == 0:
with open(INPUT_DIR + '/appl_db.json') as f:
Expand Down Expand Up @@ -64,6 +64,6 @@ def keys(self, pattern='*'):
return [key for key in self.redis.keys() if regex.match(key.decode('utf-8'))]


sswsdk.interface.DBInterface._subscribe_keyspace_notification = _subscribe_keyspace_notification
swsssdk.interface.DBInterface._subscribe_keyspace_notification = _subscribe_keyspace_notification
mockredis.MockRedis.config_set = config_set
redis.StrictRedis = SSWSyncClient
redis.StrictRedis = SwssSyncClient

0 comments on commit d39b66b

Please sign in to comment.