Esempio n. 1
0
def shutdown(code, reason):
    '''Shutdown gracefully.'''

    # Import required Python function.
    from sys import exit

    # Import required libnuclix modules.
    import logger, module, server, conn, var

    logger.info('libnuclix.shutdown(): exiting with code %d: %s' % (code, reason))
    module.unload_all()
    conn.disconnect(code, reason)

    for i in var.servers:
        server.delete(i)

    exit(code)
Esempio n. 2
0
def delete_command():
    server.delete(selected_tuple[0])
Esempio n. 3
0
import string
from d3des import deskey
from netaddr import IPAddress
from pysphere.resources import VimService_services as VI
from server import get_server, get_center, get_ssh, get_arg, response, append, space, path, write, delete

def generate_key(password):
  c_password = (password + '\x00' * 8)[:8]
  encrypted = deskey(c_password, False)
  encrypted_bytes = struct.pack('i' * 32, *encrypted)
  encrypted_string = base64.b64encode(encrypted_bytes)
  key = (encrypted_string)
  return key

# Log
delete('log')

# Status
write('status', '1:5')

# Connect to server
serve = get_center()

if not serve:
  serve = get_server()
  
if not serve:
  response(False, log=10)

# Status
write('status', '1:15')
Esempio n. 4
0
import server as s
s.create("vamsi", 25)
s.create("reddy", 70, 3600)
s.read("vamsi")
s.read("reddy")
s.create("vamsi", 50)
s.modify("vamsi", 55)
s.delete("vamsi")
t1 = Thread(target=(create or read or delete),
            args=(key_name, value, timeout))  #as per the operation
t1.start()
t1.sleep()
t2 = Thread(target=(create or read or delete),
            args=(key_name, value, timeout))  #as per the operation
t2.start()
t2.sleep()
Esempio n. 5
0
            'Delete User'
        ])

        if menu == 0:
            site = input("Enter the site (include 'https://'): ")
            login = input("Enter the username: "******"Enter the password: "******"Successfully inserted data into table!" +
                        Style.RESET_ALL)

        elif menu == 1:
            server.get_info(c, user)

        elif menu == 2:
            server.delete(c, user)
            logger.warn("Succesfully deleted!")

        elif menu == 3:
            logger.debug('menu option 4 - delete user')
            # c.execute("SELECT secret FROM secrets WHERE username=%s", (user, ))
            # for y in c:
            #     secret = str(y)

            # c.execute("SELECT email FROM secrets WHERE username=%s", (user, ))

            # for x in c:
            #     dataEmail = x

            tbotp = totp.generate_totp(secret)
            mail.send_secret(email, dataEmail, emailPass, tbotp)
Esempio n. 6
0
def test_delete_error():
    delete('os error')
Esempio n. 7
0
def test_delete(remove):
    delete('1', '2', '3')
    eq_(remove.call_args_list, [call('1'), call('2'), call('3')])
Esempio n. 8
0
import re
import sys
import time
import help
import shutil
import libvirt
from server import get_arg, get_server, write, delete

# Log
delete('log')

# Status
write('status', '1:5')

# VM name
name = get_arg('ip[ip]')

# Template
template = get_arg('os[kvm_type]')

# Pool data
pool_name = get_arg('datastore[pool_name]')
pool_path = get_arg('datastore[pool_path]')

# Connect to KVM
serve = get_server()

# Default pool
try:
  default_pool = serve.storagePoolLookupByName(pool_name)
except: