def commitvalidation(self):
     """ Commit method validation function """
     try:
         self._rdmc.app.get_current_client()
     except:
         raise NoCurrentSessionEstablished("Please login and make setting" \
                                   " changes before using commit command.")
    def statusvalidation(self, options):
        """ Status method validation function """

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

        try:
            _ = self._rdmc.app.current_client
        except:
            raise NoCurrentSessionEstablished("Please login and make setting" \
                                      " changes before using status command.")
 def commitvalidation(self, options):
     """ Commit method validation function """
     try:
         client = self._rdmc.app.get_current_client()
         if options.user and options.password:
             if not client.get_username():
                 client.set_username(options.user)
             if not client.get_password():
                 client.set_password(options.password)
     except:
         raise NoCurrentSessionEstablished("Please login and make setting" \
                                   " changes before using commit command.")