removed deprecated tools
* tools/experimental_ssh_eventlet.py * tools/state_transitions.py Change-Id: I6fd8642bcabab16bb7062637d7b8b864f09f1c80
This commit is contained in:
parent
9ba541b9ee
commit
318669f408
@ -1,60 +0,0 @@
|
|||||||
#!/usr/bin/python
|
|
||||||
|
|
||||||
import eventlet
|
|
||||||
from eventlet.green import socket
|
|
||||||
import libssh2
|
|
||||||
import os
|
|
||||||
import random
|
|
||||||
|
|
||||||
|
|
||||||
def monitor(hostname, username, id):
|
|
||||||
|
|
||||||
print('%s %s %d' % (hostname, username, id))
|
|
||||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
||||||
sock.connect((hostname, 22))
|
|
||||||
|
|
||||||
session = libssh2.Session()
|
|
||||||
started = False
|
|
||||||
while not started:
|
|
||||||
try:
|
|
||||||
session.startup(sock)
|
|
||||||
started = True
|
|
||||||
except:
|
|
||||||
eventlet.sleep(1)
|
|
||||||
session.userauth_publickey_fromfile(
|
|
||||||
username,
|
|
||||||
os.path.expanduser('~/.ssh/id_rsa.pub'),
|
|
||||||
os.path.expanduser('~/.ssh/id_rsa'),
|
|
||||||
'')
|
|
||||||
|
|
||||||
while True:
|
|
||||||
sl = random.randint(1, 20)
|
|
||||||
eventlet.sleep(sl)
|
|
||||||
channel = session.channel()
|
|
||||||
channel.execute('uname -a')
|
|
||||||
|
|
||||||
stdout = []
|
|
||||||
#stderr = []
|
|
||||||
|
|
||||||
while not channel.eof:
|
|
||||||
data = channel.read(1024)
|
|
||||||
if data:
|
|
||||||
stdout.append(data)
|
|
||||||
|
|
||||||
#data = channel.read(1024, libssh2.STDERR)
|
|
||||||
#if data:
|
|
||||||
# stderr.append(data)
|
|
||||||
|
|
||||||
print('%d %d %s' % (id, sl, ''.join(stdout)))
|
|
||||||
#print ''.join(stderr)
|
|
||||||
|
|
||||||
|
|
||||||
pool = eventlet.GreenPool()
|
|
||||||
i = 1
|
|
||||||
while True:
|
|
||||||
pool.spawn_n(monitor, '192.168.122.238', 'root', i)
|
|
||||||
i = i + 1
|
|
||||||
if i > 800:
|
|
||||||
break
|
|
||||||
|
|
||||||
pool.waitall()
|
|
@ -1,41 +0,0 @@
|
|||||||
#!/usr/bin/python
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
||||||
# not use this file except in compliance with the License. You may obtain
|
|
||||||
# a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
# License for the specific language governing permissions and limitations
|
|
||||||
# under the License.
|
|
||||||
|
|
||||||
"""Generate a list of all possible state transitions.
|
|
||||||
|
|
||||||
Useful as a starting point for documentation.
|
|
||||||
"""
|
|
||||||
|
|
||||||
from heat.engine import resource
|
|
||||||
|
|
||||||
actions = resource.Resource.ACTIONS
|
|
||||||
stack_statuses = resource.Resource.STATUSES
|
|
||||||
engine_statuses = ("Alive", "Dead")
|
|
||||||
|
|
||||||
print("""\
|
|
||||||
| Orig action | Stack status | Engine status | New action | Behavior |
|
|
||||||
|-------------+--------------+---------------+------------+------------------|\
|
|
||||||
""")
|
|
||||||
|
|
||||||
for orig_action in actions:
|
|
||||||
for stack_status in stack_statuses:
|
|
||||||
for new_action in actions:
|
|
||||||
if stack_status == resource.Resource.IN_PROGRESS:
|
|
||||||
for engine_status in engine_statuses:
|
|
||||||
print("| %11s | %12s | %13s | %10s | |" \
|
|
||||||
% (orig_action, stack_status, engine_status,
|
|
||||||
new_action))
|
|
||||||
else:
|
|
||||||
print("| %11s | %12s | %13s | %10s | |" \
|
|
||||||
% (orig_action, stack_status, "NA", new_action))
|
|
Loading…
Reference in New Issue
Block a user