Beispiel #1
0
def host_client():
    print "HOST CLIENT IS OBSOLETE"
    sys.exit(1)
    return SOCKET.CLIENT(
        CONFIG.pdhosts_server_host, CONFIG.pdhosts_server_port,
        (CONFIG.client_private_key_file, CONFIG.client_certificate_file,
         CONFIG.ca_certificate_file))
Beispiel #2
0
def disk_client(volume):
    print "DISK CLIENT IS CURRENTLY OFFLINE"
    sys.exit(1)

    volume_servers = {
        "vol0": "solverh1",
        "vol1": "solverh1",
        "vol2": "solverh2",
        "vol3": "solverh2"
    }
    return SOCKET.CLIENT(
        volume_servers[volume], CONFIG.pddisk_server_port,
        (CONFIG.client_private_key_file, CONFIG.client_certificate_file,
         CONFIG.ca_certificate_file))
Beispiel #3
0
    def __init__(self):
        self.session_directory = CONFIG.session_directory
        self.sessions = {}
        self.next_id = 1
        self.server_id = "pd/%s" % os.environ["HOSTNAME"]
        self.hosts_client = client = SOCKET.CLIENT(
            CONFIG.pdhosts_server_host, CONFIG.pdhosts_server_port,
            (CONFIG.client_private_key_file, CONFIG.client_certificate_file,
             CONFIG.ca_certificate_file))

        print "our test %s" % self.hosts_client.Host_List()
        self.Read_All_Sessions()

        # Define RPC interface
        self.mutex = threading.Lock()
        self.commands = [
            "Session_Info", "Session_List", "Create_Session",
            "Activate_Session", "Deactivate_Session", "Label_Session",
            "Update_State", "Host_List", "Update_Status",
            "Remove_Status_If_Exists", "Session_Directory"
        ]
Beispiel #4
0
from pd.common import CONFIG
from pd.common import SOCKET
import sys
import time
import os
import socket
import dialog

client = None
try:
    client = SOCKET.CLIENT(
        CONFIG.pdsim_server_host, CONFIG.pdsim_server_port,
        (CONFIG.client_private_key_file, CONFIG.client_certificate_file,
         CONFIG.ca_certificate_file))

#    client=SOCKET.CLIENT(os.environ["PSIM_SERVER_HOST"],int(os.environ["PSIM_SERVER_PORT"]),
#                         (os.environ["PSIM_CLIENT_KEY"],os.environ["PSIM_CLIENT_CERT"],os.environ["PSIM_CA_CERT"]))
except KeyError:
    print "You must define the environment variables PSIM_SERVER_HOST and PSIM_SERVER_PORT, PSIM_CLIENT_KEY, \nPSIM_CA_CERT, PSIM_CLIENT_CERT"
    sys.exit(1)
except socket.error:
    print "Unable to connect to server"
    sys.exit(1)

username = os.environ["USER"]


def handle_dialog_code(d, code):
    if code in (d.DIALOG_CANCEL, d.DIALOG_ESC):
        sys.exit(1)
    return 0
Beispiel #5
0
def mon_client(timeout=0):
    return SOCKET.CLIENT(CONFIG.pdmon_server_host, CONFIG.pdmon_server_port,
                         None, timeout)