Skip to content

Commit

Permalink
Updating to version 2.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Yergidy committed Oct 19, 2018
1 parent dec6418 commit 5d2b14c
Show file tree
Hide file tree
Showing 49 changed files with 708 additions and 112 deletions.
2 changes: 2 additions & 0 deletions rdmc-pyinstaller-mac.spec
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def getData():

return datalist

compileall.compile_dir('.', force=True, quiet=True)

a = Analysis(['.//src//rdmc.py'],
pathex=[],
binaries=None,
Expand Down
16 changes: 14 additions & 2 deletions src/extensions/BIOS COMMANDS/BiosDefaultsCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

import sys

from optparse import OptionParser
from optparse import OptionParser, SUPPRESS_HELP
from rdmc_base_classes import RdmcCommandBase
from rdmc_helper import ReturnCodes, InvalidCommandLineError, \
from rdmc_helper import ReturnCodes, InvalidCommandLineError, Encryption,\
InvalidCommandLineErrorOPTS

class BiosDefaultsCommand(RdmcCommandBase):
Expand Down Expand Up @@ -55,6 +55,10 @@ def run(self, line):
else:
raise InvalidCommandLineErrorOPTS("")

if options.encode and options.user and options.password:
options.user = Encryption.decode_credentials(options.user)
options.password = Encryption.decode_credentials(options.password)

self.defaultsvalidation(options)

sys.stdout.write(u'Resetting the currently logged in server\'s BIOS' \
Expand Down Expand Up @@ -201,3 +205,11 @@ def definearguments(self, customparser):
"defaults.",
default=False
)
customparser.add_option(
'-e',
'--enc',
dest='encode',
action='store_true',
help=SUPPRESS_HELP,
default=False,
)
15 changes: 13 additions & 2 deletions src/extensions/BIOS COMMANDS/BootOrderCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import ast
import copy

from optparse import OptionParser
from optparse import OptionParser, SUPPRESS_HELP
from rdmc_base_classes import RdmcCommandBase
from rdmc_helper import ReturnCodes, InvalidCommandLineError, \
from rdmc_helper import ReturnCodes, InvalidCommandLineError, Encryption,\
InvalidCommandLineErrorOPTS, BootOrderMissingEntriesError,\
InvalidOrNothingChangedSettingsError

Expand Down Expand Up @@ -81,6 +81,9 @@ def run(self, line):
raise InvalidCommandLineErrorOPTS("")

if len(args) < 2:
if options.encode and options.user and options.password:
options.user = Encryption.decode_credentials(options.user)
options.password = Encryption.decode_credentials(options.password)
self.bootordervalidation(options)
else:
raise InvalidCommandLineError("Invalid number of parameters." \
Expand Down Expand Up @@ -595,3 +598,11 @@ def definearguments(self, customparser):
" descriptions regarding the reboot flag, run help reboot.",
default=None,
)
customparser.add_option(
'-e',
'--enc',
dest='encode',
action='store_true',
help=SUPPRESS_HELP,
default=False,
)
16 changes: 14 additions & 2 deletions src/extensions/BIOS COMMANDS/IscsiConfigCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
import sys
import json

from optparse import OptionParser
from optparse import OptionParser, SUPPRESS_HELP

import redfish.ris

from rdmc_base_classes import RdmcCommandBase
from rdmc_helper import ReturnCodes, InvalidCommandLineError, \
from rdmc_helper import ReturnCodes, InvalidCommandLineError, Encryption,\
InvalidCommandLineErrorOPTS, NicMissingOrConfigurationError,\
BootOrderMissingEntriesError

Expand Down Expand Up @@ -83,6 +83,10 @@ def run(self, line):
else:
raise InvalidCommandLineErrorOPTS("")

if options.encode and options.user and options.password:
options.user = Encryption.decode_credentials(options.user)
options.password = Encryption.decode_credentials(options.password)

self.iscsiconfigurationvalidation(options)

if self.typepath.defs.biospath[-1] == '/':
Expand Down Expand Up @@ -798,3 +802,11 @@ def definearguments(self, customparser):
" descriptions regarding the reboot flag, run help reboot.",
default=None,
)
customparser.add_option(
'-e',
'--enc',
dest='encode',
action='store_true',
help=SUPPRESS_HELP,
default=False,
)
17 changes: 15 additions & 2 deletions src/extensions/BIOS COMMANDS/PendingChangesCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
import copy
import json

from optparse import OptionParser
from optparse import OptionParser, SUPPRESS_HELP

import jsondiff

from rdmc_base_classes import RdmcCommandBase, HARDCODEDLIST
from rdmc_helper import ReturnCodes, InvalidCommandLineError, \
from rdmc_helper import ReturnCodes, InvalidCommandLineError, Encryption,\
InvalidCommandLineErrorOPTS, UI

class PendingChangesCommand(RdmcCommandBase):
Expand Down Expand Up @@ -62,6 +62,11 @@ def run(self, line):
if args:
raise InvalidCommandLineError("Pending command does not take any " \
"arguments.")

if options.encode and options.user and options.password:
options.user = Encryption.decode_credentials(options.user)
options.password = Encryption.decode_credentials(options.password)

self.pendingvalidation(options)

self.pendingfunction()
Expand Down Expand Up @@ -216,3 +221,11 @@ def definearguments(self, customparser):
help="""Use the provided iLO password to log in.""",
default=None,
)
customparser.add_option(
'-e',
'--enc',
dest='encode',
action='store_true',
help=SUPPRESS_HELP,
default=False,
)
17 changes: 15 additions & 2 deletions src/extensions/BIOS COMMANDS/ResultsCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

import sys

from optparse import OptionParser
from optparse import OptionParser, SUPPRESS_HELP
from rdmc_base_classes import RdmcCommandBase
from rdmc_helper import ReturnCodes, InvalidCommandLineError, \
from rdmc_helper import ReturnCodes, InvalidCommandLineError, Encryption,\
InvalidCommandLineErrorOPTS

class ResultsCommand(RdmcCommandBase):
Expand Down Expand Up @@ -57,6 +57,11 @@ def run(self, line):
if args:
raise InvalidCommandLineError("Results command does not take any " \
"arguments.")

if options.encode and options.user and options.password:
options.user = Encryption.decode_credentials(options.user)
options.password = Encryption.decode_credentials(options.password)

self.resultsvalidation(options)
results = {}
if self.typepath.defs.biospath[-1] == '/':
Expand Down Expand Up @@ -234,3 +239,11 @@ def definearguments(self, customparser):
help="""Use the provided iLO password to log in.""",
default=None,
)
customparser.add_option(
'-e',
'--enc',
dest='encode',
action='store_true',
help=SUPPRESS_HELP,
default=False,
)
16 changes: 14 additions & 2 deletions src/extensions/BIOS COMMANDS/SetPasswordCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import sys
import getpass

from optparse import OptionParser
from optparse import OptionParser, SUPPRESS_HELP
from rdmc_base_classes import RdmcCommandBase
from rdmc_helper import ReturnCodes, InvalidCommandLineError, \
from rdmc_helper import ReturnCodes, InvalidCommandLineError, Encryption,\
InvalidCommandLineErrorOPTS

class SetPasswordCommand(RdmcCommandBase):
Expand Down Expand Up @@ -65,6 +65,10 @@ def run(self, line):
else:
raise InvalidCommandLineErrorOPTS("")

if options.encode and options.user and options.password:
options.user = Encryption.decode_credentials(options.user)
options.password = Encryption.decode_credentials(options.password)

self.setpasswordvalidation(options)

if not args:
Expand Down Expand Up @@ -227,3 +231,11 @@ def definearguments(self, customparser):
help="""Use this flag to set power on password instead""",
default=None,
)
customparser.add_option(
'-e',
'--enc',
dest='encode',
action='store_true',
help=SUPPRESS_HELP,
default=False,
)
17 changes: 15 additions & 2 deletions src/extensions/COMMANDS/CommitCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

import sys

from optparse import OptionParser
from rdmc_helper import ReturnCodes, InvalidCommandLineErrorOPTS, \
from optparse import OptionParser, SUPPRESS_HELP
from rdmc_helper import ReturnCodes, InvalidCommandLineErrorOPTS, Encryption, \
NoChangesFoundOrMadeError, NoCurrentSessionEstablished

from rdmc_base_classes import RdmcCommandBase
Expand Down Expand Up @@ -52,6 +52,11 @@ def commitfunction(self, options=None):
:param options: command line options
:type options: list.
"""

if options.encode and options.user and options.password:
options.user = Encryption.decode_credentials(options.user)
options.password = Encryption.decode_credentials(options.password)

self.commitvalidation(options)

sys.stdout.write(u"Committing changes...\n")
Expand Down Expand Up @@ -147,3 +152,11 @@ def definearguments(self, customparser):
" command to execute.",
default=None,
)
customparser.add_option(
'-e',
'--enc',
dest='encode',
action='store_true',
help=SUPPRESS_HELP,
default=False,
)
16 changes: 14 additions & 2 deletions src/extensions/COMMANDS/GetCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
# -*- coding: utf-8 -*-
""" Get Command for RDMC """

from optparse import OptionParser
from optparse import OptionParser, SUPPRESS_HELP
from collections import (OrderedDict)
import collections

import redfish.ris

from rdmc_helper import ReturnCodes, \
from rdmc_helper import ReturnCodes, Encryption, \
InvalidCommandLineErrorOPTS, UI, \
NoContentsFoundForOperationError

Expand Down Expand Up @@ -64,6 +64,10 @@ def run(self, line):
else:
raise InvalidCommandLineErrorOPTS("")

if options.encode and options.user and options.password:
options.user = Encryption.decode_credentials(options.user)
options.password = Encryption.decode_credentials(options.password)

self.getvalidation(options)

multiargs = False
Expand Down Expand Up @@ -521,3 +525,11 @@ def definearguments(self, customparser):
"is configurable with the selected type(s).",
default=False
)
customparser.add_option(
'-e',
'--enc',
dest='encode',
action='store_true',
help=SUPPRESS_HELP,
default=False,
)
16 changes: 14 additions & 2 deletions src/extensions/COMMANDS/InfoCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@

import sys

from optparse import OptionParser
from optparse import OptionParser, SUPPRESS_HELP

import redfish.ris

from rdmc_helper import ReturnCodes, InvalidCommandLineErrorOPTS, UI,\
from rdmc_helper import ReturnCodes, InvalidCommandLineErrorOPTS, UI, Encryption, \
InfoMissingEntriesError

from rdmc_base_classes import RdmcCommandBase, HARDCODEDLIST
Expand Down Expand Up @@ -66,6 +66,10 @@ def run(self, line, autotest=False):
else:
raise InvalidCommandLineErrorOPTS("")

if options.encode and options.user and options.password:
options.user = Encryption.decode_credentials(options.user)
options.password = Encryption.decode_credentials(options.password)

self.infovalidation(options)

if args:
Expand Down Expand Up @@ -303,3 +307,11 @@ def definearguments(self, customparser):
"retrieval due to difference in schema versions.",
default=None
)
customparser.add_option(
'-e',
'--enc',
dest='encode',
action='store_true',
help=SUPPRESS_HELP,
default=False,
)
16 changes: 14 additions & 2 deletions src/extensions/COMMANDS/ListCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

# -*- coding: utf-8 -*-
""" List Command for RDMC """
from optparse import OptionParser
from optparse import OptionParser, SUPPRESS_HELP

import redfish.ris

from rdmc_base_classes import RdmcCommandBase
from rdmc_helper import ReturnCodes, InvalidCommandLineErrorOPTS,\
from rdmc_helper import ReturnCodes, InvalidCommandLineErrorOPTS, Encryption, \
NoContentsFoundForOperationError

class ListCommand(RdmcCommandBase):
Expand Down Expand Up @@ -59,6 +59,10 @@ def run(self, line):
else:
raise InvalidCommandLineErrorOPTS("")

if options.encode and options.user and options.password:
options.user = Encryption.decode_credentials(options.user)
options.password = Encryption.decode_credentials(options.password)

self.listvalidation(options)

if args:
Expand Down Expand Up @@ -246,3 +250,11 @@ def definearguments(self, customparser):
" there. ",
default=None,
)
customparser.add_option(
'-e',
'--enc',
dest='encode',
action='store_true',
help=SUPPRESS_HELP,
default=False,
)
Loading

0 comments on commit 5d2b14c

Please sign in to comment.