Skip to content

Commit

Permalink
2.9.0 (#65)
Browse files Browse the repository at this point in the history
TOOLS-2066
(ASADM) Add sindex cardinality to show sindex and info sindex commands.

Improvement
TOOLS-2063
(ASADM) Add the ability to create sindexs on CDTs by providing a context to the manage sindex create command.

New Feature
TOOLS-2061
(ASADM) Support POSIX compatible input in interactive mode.
  • Loading branch information
Jesse S authored Aug 29, 2022
1 parent dc87c6b commit 00b2926
Show file tree
Hide file tree
Showing 20 changed files with 4,626 additions and 104 deletions.
3 changes: 2 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ yappi = "==0.98"
pyOpenSSL = "==18.0.0"
setuptools = "*"
aiohttp = "==3.8.1"
python-dateutil = "*"
python-dateutil = "2.8.2"
msgpack = "1.0.4"

[dev-packages]
pyinstaller = "==4.10"
Expand Down
130 changes: 94 additions & 36 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 31 additions & 17 deletions asadm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from lib.utils.logger import logger # THIS MUST BE THE FIRST IMPORT
from lib.base_controller import ShellException
import inspect
import cmd
import getpass
Expand All @@ -25,6 +27,7 @@
import sys
import asyncio
import readline

from lib.utils.async_object import AsyncObject


Expand All @@ -36,7 +39,6 @@

# Setup logger before anything

from lib.utils.logger import logger
from lib.collectinfo_analyzer.collectinfo_root_controller import (
CollectinfoRootController,
)
Expand All @@ -58,7 +60,7 @@
# codec is registered well before it is used in getaddrinfo.
# see https://bugs.python.org/issue29288, https://github.com/aws/aws-cli/blob/1.16.277/awscli/clidriver.py#L55,
# and https://github.com/pyinstaller/pyinstaller/issues/1113 for more info :)
u"".encode("idna")
"".encode("idna")

# Do not remove this line. It mitigates a race condition that occurs when using
# pyinstaller and socket.getaddrinfo. For some reason the idna codec is not registered
Expand Down Expand Up @@ -263,31 +265,43 @@ def set_privaliged_prompt(self):

def clean_line(self, line):
# get rid of extra whitespace
lexer = shlex.shlex(line)
lexer = shlex.shlex(line, posix=True)
# TODO: shlex is not working with 'with' ip addresses. Need to write a
# new parser or correct shlex behavior.
commands = []

command = []
build_token = ""
lexer.wordchars += ".*-:/_{}@"
for token in lexer:
build_token += token
if token == "-":
continue

if token == ";":
if command:
# Maybe someday we should not allow most of the characters below without
# quotes surrounding them. These characters below define what can be in
# an unquotes string.
lexer.wordchars += r"`~!@#$;%^&*()_-+={}[]|:<>,./\?"
lexer.escapedquotes += "'"

try:
for token in lexer:
build_token += token

if token == ";":
if command:
commands.append(command)
command = []
elif token.endswith(";"):
command.append(build_token[:-1])
commands.append(command)
command = []
else:
command.append(build_token)
build_token = ""
else:
command.append(build_token)
build_token = ""
else:
if build_token:
command.append(build_token)
if command:
commands.append(command)
if build_token:
command.append(build_token)
if command:
commands.append(command)

except ValueError as e:
raise ShellException(e)

return commands

Expand Down
2 changes: 1 addition & 1 deletion lib/base_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def _run_results(self, results):
rv.append(result)
return rv

async def execute(self, line) -> Union[None, str, list[None]]:
async def execute(self, line: list[str]) -> Union[None, str, list[None]]:
# Init all command controller objects
self._init()

Expand Down
7 changes: 7 additions & 0 deletions lib/live_cluster/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

from .cluster import Cluster

from .ctx import CTXItem, CTXItems, CDTContext, ASValue, ASValues

__all__ = (
Cluster,
ASInfoError,
Expand All @@ -44,4 +46,9 @@
EnumConfigType,
StringConfigType,
IntConfigType,
CTXItem,
CTXItems,
CDTContext,
ASValue,
ASValues,
)
Loading

0 comments on commit 00b2926

Please sign in to comment.