Giter VIP home page Giter VIP logo

monster's People

Contributors

breu avatar charleskimpolo avatar cjoelrun avatar jacobwagner avatar jcourtois avatar xeregin avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

monster's Issues

Namespaces are unOOPy

Long class names are not particularly Pythonic. Lean on modules and packages.

environment.base
monster.environment.base
monster.environments.chef.environment
monster.environments.base
orchs should be something like
monster.orchestratiors.base
monster.orchestrators.chef.wrappers.chef

Tempest tests fail

Running the testing option with the Tempest suite specified returns an error related to the environment override variables not being an attribute of that object.

Environment Remnant

When an error occurs during a deployment and compute.py errors out, the environment isn't wiped (we need to delete the environment on failure to build)

Unable to provision onto Public Cloud

Monster's currently failing to build onto Public Cloud due to the OpenStack sub-class's implementation of reload_node_list not being picked up for whatever reason.

This is raising a NotImplementedError. Not sure how the other open pull requests will affect this bug.

Relevant lines:

root@julian-monster:~/monster# ./compute.py build -s secret.yaml  --template ubuntu-ha
2014-05-13 16:04:40,386 - monster - WARNING - You are not using the virtual environment! We cannot guarantee that your monster will be well-behaved.  To load the virtual environment, use the command "source .venv/bin/activate"
2014-05-13 16:04:40,451 - monster.orchestrator.chef_deployment_orchestrator - INFO - Building deployment object for autotest
2014-05-13 16:04:40,893 - monster.orchestrator.chef_deployment_orchestrator - DEBUG - Provisioner: Rackspace
2014-05-13 16:04:40,907 - monster.orchestrator.chef_deployment_orchestrator - INFO - Using previous deployment:autotest
2014-05-13 16:04:40,932 - monster.environments.base_environment_wrapper - DEBUG - default_attributes: {}
2014-05-13 16:04:40,932 - monster.environments.base_environment_wrapper - DEBUG - description: autotest
2014-05-13 16:04:40,932 - monster.environments.base_environment_wrapper - DEBUG - override_attributes: {}
2014-05-13 16:04:40,932 - monster.environments.base_environment_wrapper - DEBUG - remote_api: None
2014-05-13 16:04:40,932 - monster.environments.base_environment_wrapper - DEBUG - local_api: <chef.api.ChefAPI object at 0x2874e90>
2014-05-13 16:04:40,932 - monster.environments.base_environment_wrapper - DEBUG - name: autotest
2014-05-13 16:04:40,976 - monster.environments.base_environment_wrapper - DEBUG - chef_type: environment
2014-05-13 16:04:40,976 - monster.environments.base_environment_wrapper - DEBUG - default_attributes: {}
2014-05-13 16:04:40,977 - monster.environments.base_environment_wrapper - DEBUG - description: autotest
2014-05-13 16:04:40,977 - monster.environments.base_environment_wrapper - DEBUG - override_attributes: {}
2014-05-13 16:04:40,977 - monster.environments.base_environment_wrapper - DEBUG - chef_server_name: None
2014-05-13 16:04:40,977 - monster.environments.base_environment_wrapper - DEBUG - remote_api: None
2014-05-13 16:04:40,977 - monster.environments.base_environment_wrapper - DEBUG - cookbook_versions: {}
2014-05-13 16:04:40,977 - monster.environments.base_environment_wrapper - DEBUG - local_api: <chef.api.ChefAPI object at 0x2874e90>
2014-05-13 16:04:40,977 - monster.environments.base_environment_wrapper - DEBUG - json_class: Chef::Environment
2014-05-13 16:04:40,977 - monster.environments.base_environment_wrapper - DEBUG - name: autotest
Traceback (most recent call last):
  File "./compute.py", line 181, in <module>
    parser.dispatch()
  File "/usr/local/lib/python2.7/dist-packages/argh/helpers.py", line 53, in dispatch
    return dispatch(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 124, in dispatch
    for line in lines:
  File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 200, in _execute_command
    for line in result:
  File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 183, in _call
    result = args.function(*positional, **keywords)
  File "./compute.py", line 32, in build
    provisioner_name)
  File "/root/monster/monster/orchestrator/chef_deployment_orchestrator.py", line 40, in create_deployment_from_file
    return self.load_deployment_from_name(name)
  File "/root/monster/monster/orchestrator/chef_deployment_orchestrator.py", line 73, in load_deployment_from_name
    chef_node_wrapper)
  File "/root/monster/monster/provisioners/provisioner.py", line 89, in load_nodes
    nodes_to_load = self.reload_node_list(env.nodes, env.local_api)
  File "/root/monster/monster/provisioners/provisioner.py", line 56, in reload_node_list
    raise NotImplementedError
NotImplementedError

Destroying builds failing from provisioner exception

When destroying failed builds, a NotImplementedError is raised from self.reload_node_list in provisioner.py.

failed: [monster.julianmontez.com] => {"changed": true, "cmd": ["python", "/root/monster/compute.py", "destroy", "--name", "julian-ubuntu-default", "--config", "configs/pubcloud-neutron.yaml", "--secret-path", "~/monster/secret.yaml"], "delta": "0:00:00.541390", "end": "2014-04-28 19:00:22.223717", "item": "", "rc": 1, "start": "2014-04-28 19:00:21.682327"}
stderr: Traceback (most recent call last):
  File "/root/monster/compute.py", line 180, in <module>
    parser.dispatch()
  File "/usr/local/lib/python2.7/dist-packages/argh/helpers.py", line 53, in dispatch
    return dispatch(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 124, in dispatch
    for line in lines:
  File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 200, in _execute_command
    for line in result:
  File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 183, in _call
    result = args.function(*positional, **keywords)
  File "/root/monster/compute.py", line 111, in destroy
    deployment = _load(name, config, secret_path=secret_path)
  File "/root/monster/compute.py", line 163, in _load
    deployment = orchestrator.load_deployment_from_name(name)
  File "/root/monster/monster/orchestrator/chef_deployment_orchestrator.py", line 72, in load_deployment_from_name
    chef_node_wrapper)
  File "/root/monster/monster/provisioners/provisioner.py", line 89, in load_nodes
    nodes_to_load = self.reload_node_list(env.nodes, env.local_api)
  File "/root/monster/monster/provisioners/provisioner.py", line 56, in reload_node_list
    raise NotImplementedError
NotImplementedError
stdout: 2014-04-28 19:00:22,023 - monster - WARNING - You are not using the virtual environment! We cannot guarantee that your monster will be well-behaved.  To load the virtual environment, use the command "source .venv/bin/activate"
2014-04-28 19:00:22,123 - monster.environments.base_environment_wrapper - DEBUG - default_attributes: {}
2014-04-28 19:00:22,123 - monster.environments.base_environment_wrapper - DEBUG - description: julian-ubuntu-default
2014-04-28 19:00:22,124 - monster.environments.base_environment_wrapper - DEBUG - override_attributes: {}
2014-04-28 19:00:22,124 - monster.environments.base_environment_wrapper - DEBUG - remote_api: None
2014-04-28 19:00:22,124 - monster.environments.base_environment_wrapper - DEBUG - local_api: <chef.api.ChefAPI object at 0x2889ed0>
2014-04-28 19:00:22,124 - monster.environments.base_environment_wrapper - DEBUG - name: julian-ubuntu-default
2014-04-28 19:00:22,162 - monster.environments.base_environment_wrapper - DEBUG - chef_type: environment
2014-04-28 19:00:22,162 - monster.environments.base_environment_wrapper - DEBUG - default_attributes: {}
2014-04-28 19:00:22,162 - monster.environments.base_environment_wrapper - DEBUG - description: julian-ubuntu-default
2014-04-28 19:00:22,162 - monster.environments.base_environment_wrapper - DEBUG - override_attributes: {}
2014-04-28 19:00:22,163 - monster.environments.base_environment_wrapper - DEBUG - chef_server_name: None
2014-04-28 19:00:22,163 - monster.environments.base_environment_wrapper - DEBUG - remote_api: None
2014-04-28 19:00:22,163 - monster.environments.base_environment_wrapper - DEBUG - cookbook_versions: {}
2014-04-28 19:00:22,163 - monster.environments.base_environment_wrapper - DEBUG - local_api: <chef.api.ChefAPI object at 0x2889ed0>
2014-04-28 19:00:22,163 - monster.environments.base_environment_wrapper - DEBUG - json_class: Chef::Environment
2014-04-28 19:00:22,163 - monster.environments.base_environment_wrapper - DEBUG - name: julian-ubuntu-default

SSH connection test never passes

After a server's networking is up and functioning, the port check never passes.

2014-04-28 19:17:58,458 - monster.provisioners.openstack - INFO - Waiting: <Server: autotest-chefserver> status:BUILD
2014-04-28 19:18:13,558 - monster.provisioners.openstack - INFO - Waiting: <Server: autotest-chefserver> status:BUILD
2014-04-28 19:18:28,961 - monster.provisioners.openstack - INFO - Waiting: <Server: autotest-chefserver> status:BUILD
2014-04-28 19:18:44,069 - monster.provisioners.openstack - INFO - Waiting: <Server: autotest-chefserver> status:BUILD
2014-04-28 19:18:59,679 - monster.provisioners.openstack - INFO - Waiting: <Server: autotest-chefserver> status:BUILD
2014-04-28 19:19:14,790 - monster.provisioners.openstack - INFO - Waiting: <Server: autotest-chefserver> status:BUILD
2014-04-28 19:19:30,159 - monster.server_helper - DEBUG - Testing connection to : :22
2014-04-28 19:19:30,162 - monster.server_helper - DEBUG - Waiting for ssh connection...
2014-04-28 19:19:31,164 - monster.server_helper - DEBUG - Waiting for ssh connection...
2014-04-28 19:19:32,167 - monster.server_helper - DEBUG - Waiting for ssh connection...
2014-04-28 19:19:33,170 - monster.server_helper - DEBUG - Waiting for ssh connection...
2014-04-28 19:19:34,173 - monster.server_helper - DEBUG - Waiting for ssh connection...
2014-04-28 19:19:35,176 - monster.server_helper - DEBUG - Waiting for ssh connection...
2014-04-28 19:19:36,178 - monster.server_helper - DEBUG - Waiting for ssh connection...
2014-04-28 19:19:37,181 - monster.server_helper - DEBUG - Waiting for ssh connection...
2014-04-28 19:19:38,184 - monster.server_helper - DEBUG - Waiting for ssh connection...
2014-04-28 19:19:39,186 - monster.server_helper - DEBUG - Waiting for ssh connection...

Openstack Provisioner cleanup

When monster crashes during rackspace/openstack provisioning, it will fail to destroy or save the instances it created.

It should either destroy the instances after and exception occurs or save them to a node so that they can be deleted with the destroy subcommand.

Not using razor still breaks everything

Monster dies when razor isn't configured--this is even when you're not using it.

root@vagrant-ubuntu-precise-64:~/monster# python compute.py build -n ubuntu-default --branch master --template ubuntu-default --config pubcloud-neutron.yaml --secret-path secret.ya ml --log log.txt --log-level DEBUG --provisioner rackspace 2014-04-02 21:18:01,456 RPC-QE INFO compute: Building deployment object for ubuntu-default 2014-04-02 21:18:01,471 RPC-QE INFO chef_deployment: Using previous deployment:ubuntu-default 2014-04-02 21:18:01,495 RPC-QE DEBUG chef_environment: chef_type: environment 2014-04-02 21:18:01,495 RPC-QE DEBUG chef_environment: default_attributes: {} 2014-04-02 21:18:01,496 RPC-QE DEBUG chef_environment: name: ubuntu-default 2014-04-02 21:18:01,496 RPC-QE DEBUG chef_environment: override_attributes: {} 2014-04-02 21:18:01,496 RPC-QE DEBUG chef_environment: chef_server_name: None 2014-04-02 21:18:01,496 RPC-QE DEBUG chef_environment: remote_api: None 2014-04-02 21:18:01,496 RPC-QE DEBUG chef_environment: cookbook_versions: {} 2014-04-02 21:18:01,496 RPC-QE DEBUG chef_environment: local_api: <chef.api.ChefAPI object at 0x2a2df50> 2014-04-02 21:18:01,496 RPC-QE DEBUG chef_environment: json_class: Chef::Environment 2014-04-02 21:18:01,496 RPC-QE DEBUG chef_environment: description: ubuntu-default Traceback (most recent call last): File "compute.py", line 234, in <module> parser.dispatch() File "/usr/local/lib/python2.7/dist-packages/argh/helpers.py", line 53, in dispatch return dispatch(self, *args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 124, in dispatch for line in lines: File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 200, in _execute_command for line in result: File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 183, in _call result = args.function(*positional, **keywords) File "compute.py", line 44, in build name, template, branch, cprovisioner, template_path) File "/root/monster/monster/deployments/chef_deployment.py", line 164, in fromfile return cls.from_chef_environment(name) File "/root/monster/monster/deployments/chef_deployment.py", line 258, in from_chef_environment provisioner = get_provisioner(provisioner_name) File "/root/monster/monster/provisioners/util.py", line 23, in get_provisioner return module_classes(identifier)[provisioner]() File "/root/monster/monster/provisioners/razor2.py", line 17, in __init__ self.url = url or util.config['secrets']['razor']['url'] KeyError: 'razor'

Modularize monster; refine deployment class

Deployments should be what we are deploying and then wrap all the other classes they need to deploy; e.g chefdeployment is really rpcs deployment.

Goal: one class for each deployment that monster can do.

Monster should support commands similar to:

./compute.py build rpcs
./compute.py build devstack

Monster unable to retrieve relevant Public Cloud info

When Monster attempts to retrieve images/networks setup on Public Cloud, it craps out.

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 327, in run
    result = self._run(*self.args, **self.kwargs)
  File "/root/monster/monster/provisioners/openstack.py", line 99, in chef_instance
    flavor=flavor)
  File "/root/monster/monster/provisioners/openstack.py", line 147, in build_instance
    flavor_obj = self._client_search(self.compute_client.flavors.list,
AttributeError: 'NoneType' object has no attribute 'flavors'
<Greenlet at 0x25390f0: <bound method Rackspace.chef_instance of rackspace>(class: Chef
        status : provisioning
        has_controller, 'ubuntu-default-chefserver', flavor='1GBP')> failed with AttributeError

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 327, in run
    result = self._run(*self.args, **self.kwargs)
  File "/root/monster/monster/provisioners/openstack.py", line 99, in chef_instance
    flavor=flavor)
  File "/root/monster/monster/provisioners/openstack.py", line 147, in build_instance
    flavor_obj = self._client_search(self.compute_client.flavors.list,
AttributeError: 'NoneType' object has no attribute 'flavors'
<Greenlet at 0x25392d0: <bound method Rackspace.chef_instance of rackspace>(class: Chef
        status : provisioning
        has_controller, 'ubuntu-default-controller', flavor='2GBP')> failed with AttributeError

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 327, in run
    result = self._run(*self.args, **self.kwargs)
  File "/root/monster/monster/provisioners/openstack.py", line 99, in chef_instance
    flavor=flavor)
  File "/root/monster/monster/provisioners/openstack.py", line 147, in build_instance
    flavor_obj = self._client_search(self.compute_client.flavors.list,
AttributeError: 'NoneType' object has no attribute 'flavors'
<Greenlet at 0x2539370: <bound method Rackspace.chef_instance of rackspace>(class: Chef
        status : provisioning
        has_controller, 'ubuntu-default-compute', flavor='8GBP')> failed with AttributeError

Traceback (most recent call last):
  File "compute.py", line 234, in <module>
    parser.dispatch()
  File "/usr/local/lib/python2.7/dist-packages/argh/helpers.py", line 53, in dispatch
    return dispatch(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 124, in dispatch
    for line in lines:
  File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 200, in _execute_command
    for line in result:
  File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 183, in _call
    result = args.function(*positional, **keywords)
  File "compute.py", line 44, in build
    name, template, branch, cprovisioner, template_path)
  File "/root/monster/monster/deployments/chef_deployment.py", line 207, in fromfile
    branch)
  File "/root/monster/monster/nodes/chef_node.py", line 171, in from_chef_node
    ipaddress = node['ipaddress']
TypeError: 'NoneType' object has no attribute '__getitem__'

Configuration file-path unrecognized

When specifying a secrets.yaml configuration file from the command-line, the file-path isn't respected. For example, when explicitly providing the path /root/monster/secret.yaml, an exception is generated.

failed: [monster.julianmontez.com] => {"changed": true, "cmd": ["/root/monster/compute.py", "build", "--name", "julian-ubuntu-default", "--branch", "master", "--template", "ubuntu-default", "--config", "pubcloud-neutron.yaml", "--secret-path", "/root/monster/secret.yaml", "--provisioner", "rackspace"], "delta": "0:00:01.136756", "end": "2014-04-28 18:49:24.049667", "item": "", "rc": 1, "start": "2014-04-28 18:49:22.912911"}
stderr: Traceback (most recent call last):
  File "/root/monster/compute.py", line 179, in <module>
    parser.dispatch()
  File "/usr/local/lib/python2.7/dist-packages/argh/helpers.py", line 53, in dispatch
    return dispatch(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 124, in dispatch
    for line in lines:
  File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 200, in _execute_command
    for line in result:
  File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 183, in _call
    result = args.function(*positional, **keywords)
  File "/root/monster/compute.py", line 32, in build
    provisioner_name)
  File "/root/monster/monster/orchestrator/chef_deployment_orchestrator.py", line 44, in create_deployment_from_file
    template = Config.fetch_template(template, branch)
  File "/root/monster/monster/config.py", line 47, in fetch_template
    template = Template(Config(template_path)[template_name])
  File "/root/monster/monster/config.py", line 25, in __init__
    with open(secret_path, 'r') as secret:
IOError: [Errno 2] No such file or directory: 'secret.yaml'
stdout: 2014-04-28 18:49:23,333 - monster - WARNING - You are not using the virtual environment! We cannot guarantee that your monster will be well-behaved.  To load the virtual environment, use the command "source .venv/bin/activate"
2014-04-28 18:49:23,407 - monster.orchestrator.chef_deployment_orchestrator - INFO - Building deployment object for julian-ubuntu-default
2014-04-28 18:49:23,878 - monster.environments.base_environment_wrapper - DEBUG - default_attributes: {}
2014-04-28 18:49:23,878 - monster.environments.base_environment_wrapper - DEBUG - description: julian-ubuntu-default
2014-04-28 18:49:23,878 - monster.environments.base_environment_wrapper - DEBUG - override_attributes: {}
2014-04-28 18:49:23,878 - monster.environments.base_environment_wrapper - DEBUG - remote_api: None
2014-04-28 18:49:23,879 - monster.environments.base_environment_wrapper - DEBUG - local_api: <chef.api.ChefAPI object at 0x2059bd0>
2014-04-28 18:49:23,879 - monster.environments.base_environment_wrapper - DEBUG - name: julian-ubuntu-default
2014-04-28 18:49:23,957 - monster.environments.base_environment_wrapper - DEBUG - chef_type: environment
2014-04-28 18:49:23,957 - monster.environments.base_environment_wrapper - DEBUG - default_attributes: {}
2014-04-28 18:49:23,957 - monster.environments.base_environment_wrapper - DEBUG - description: julian-ubuntu-default
2014-04-28 18:49:23,957 - monster.environments.base_environment_wrapper - DEBUG - override_attributes: {}
2014-04-28 18:49:23,957 - monster.environments.base_environment_wrapper - DEBUG - chef_server_name: None
2014-04-28 18:49:23,957 - monster.environments.base_environment_wrapper - DEBUG - remote_api: None
2014-04-28 18:49:23,958 - monster.environments.base_environment_wrapper - DEBUG - cookbook_versions: {}
2014-04-28 18:49:23,958 - monster.environments.base_environment_wrapper - DEBUG - local_api: <chef.api.ChefAPI object at 0x2059bd0>
2014-04-28 18:49:23,958 - monster.environments.base_environment_wrapper - DEBUG - json_class: Chef::Environment
2014-04-28 18:49:23,958 - monster.environments.base_environment_wrapper - DEBUG - name: julian-ubuntu-default

Builds blocked by `grub-pc` config menu

Since the distribution's upgraded, the GRUB config prompt blocks builds from being completely automated.

This feature is against Public Cloud's best practices for Ubuntu Server, so it should be removed from this provisioner.

2014-04-25 21:36:41,424 - monster.deployments.deployment - DEBUG - Building node Node - name:julian-ubuntu-default-chefserver, os:ubuntu, branch:master, ip:23.253.150.175, status:provisioning
                Features: chefserver!
2014-04-25 21:36:41,499 - monster.nodes.chef_node - DEBUG - setting in_use to chefserver on julian-ubuntu-default-chefserver
2014-04-25 21:36:41,518 - monster.nodes.chef_node - DEBUG - Saving chef_node:julian-ubuntu-default-chefserver
2014-04-25 21:36:41,586 - monster.nodes.node - INFO - Updating node dist / packages
2014-04-25 21:36:41,586 - monster.nodes.chef_node - DEBUG - getting platform on julian-ubuntu-default-chefserver
2014-04-25 21:36:41,604 - monster.nodes.node - INFO - Updating Distribution Packages
2014-04-25 21:36:41,605 - monster.nodes.node - INFO - Running: apt-get update; apt-get dist-upgrade -y on julian-ubuntu-default-chefserver
...
2014-04-25 21:37:18,237 - monster.server_helper - INFO - Setting up grub-pc (1.99-21ubuntu3.14) ...
2014-04-25 21:37:19,337 - monster.server_helper - INFO - Configuring grub-pc
2014-04-25 21:37:19,337 - monster.server_helper - INFO - -------------------
2014-04-25 21:37:19,337 - monster.server_helper - INFO -
2014-04-25 21:37:19,337 - monster.server_helper - INFO - The grub-pc package is being upgraded. This menu allows you to select which
2014-04-25 21:37:19,338 - monster.server_helper - INFO - devices you'd like grub-install to be automatically run for, if any.
2014-04-25 21:37:19,338 - monster.server_helper - INFO -
2014-04-25 21:37:19,338 - monster.server_helper - INFO - Running grub-install automatically is recommended in most situations, to prevent
2014-04-25 21:37:19,338 - monster.server_helper - INFO - the installed GRUB core image from getting out of sync with GRUB modules or
2014-04-25 21:37:19,338 - monster.server_helper - INFO - grub.cfg.
2014-04-25 21:37:19,338 - monster.server_helper - INFO -
2014-04-25 21:37:19,338 - monster.server_helper - INFO - If you're unsure which drive is designated as boot drive by your BIOS, it is
2014-04-25 21:37:19,338 - monster.server_helper - INFO - often a good idea to install GRUB to all of them.
2014-04-25 21:37:19,338 - monster.server_helper - INFO -
2014-04-25 21:37:19,338 - monster.server_helper - INFO - Note: it is possible to install GRUB to partition boot records as well, and some
2014-04-25 21:37:19,339 - monster.server_helper - INFO - appropriate partitions are offered here. However, this forces GRUB to use the
2014-04-25 21:37:19,339 - monster.server_helper - INFO - blocklist mechanism, which makes it less reliable, and therefore is not
2014-04-25 21:37:19,339 - monster.server_helper - INFO - recommended.
2014-04-25 21:37:19,339 - monster.server_helper - INFO -
2014-04-25 21:37:19,339 - monster.server_helper - INFO - 1. /dev/xvda (21474 MB; ???)  2. /dev/xvda1 (21473 MB; ???)
2014-04-25 21:37:19,339 - monster.server_helper - INFO -
2014-04-25 21:37:19,339 - monster.server_helper - INFO - (Enter the items you want to select, separated by spaces.)

Need better error handling for deployments which don't exist

There should be an assumption that when a configuration can't be loaded automatically, that the name doesn't exist.

root@monster:~# monster show julian-autotest
2014-05-27 18:52:25,288 - monster - WARNING - You are not using the virtual environment! We cannot guarantee that your monster will be well-behaved.  To load the virtual environment, use the command "source .venv/bin/activate"
Traceback (most recent call last):
  File "/usr/local/bin/monster", line 9, in <module>
    load_entry_point('monster==0.1.0', 'console_scripts', 'monster')()
  File "/root/monster/monster/executable.py", line 205, in run
    parser.dispatch()
  File "/usr/local/lib/python2.7/dist-packages/argh/helpers.py", line 53, in dispatch
    return dispatch(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 124, in dispatch
    for line in lines:
  File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 200, in _execute_command
    for line in result:
  File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 183, in _call
    result = args.function(*positional, **keywords)
  File "/root/monster/monster/executable.py", line 167, in show
    deployment = data.load_deployment(name)
  File "/root/monster/monster/data/data.py", line 15, in load_deployment
    load_config(name)
  File "/root/monster/monster/data/data.py", line 21, in load_config
    active.config = fetch_config(name)
  File "/root/monster/monster/data/data.py", line 32, in fetch_config
    with open(_config_path(config), 'r') as f:
IOError: [Errno 2] No such file or directory: '/root/monster/monster/data/configs/None'

trying to access and index that doesnt exists all the time

In [2]: depl = load("sat6-centos-novanet-actived", "./sat6-novanet.yaml")
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-2-eb12b2637757> in <module>()
----> 1 depl = load("sat6-centos-novanet-actived", "./sat6-novanet.yaml")

/home/solo4572/workspace/jacobwagner/monster/tools/ipython.pyc in load(name, config)
     20 
     21     util.config = Config(config)
---> 22     return Chef.from_chef_environment(name)

/home/solo4572/workspace/jacobwagner/monster/monster/deployments/chef_deployment.pyc in from_chef_environment(cls, environment)
    213         """
    214 
--> 215         logger.set_log_level()
    216         local_api = autoconfigure()
    217         env = ChefEnvironment(environment, api=local_api)

/home/solo4572/workspace/jacobwagner/monster/monster/util.pyc in set_log_level(self, level)
     33             log_level = getattr(logging, level, logging.DEBUG)
     34         else:
---> 35             level = logging.getLogger("compute").handlers[0].level
     36             if level == 0:
     37                 level = logging.getLogger("storage").level

IndexError: list index out of range

When a log file is deleted, things go bad

(.venv)solo4572@solo4572 monster @ master $ ./compute.py tmux -n sat6-ubuntu-ha-neutron -c configs/sat6-neutron.yaml 
Traceback (most recent call last):
  File "./compute.py", line 11, in <module>
    from monster import util
  File "/home/solo4572/workspace/jacobwagner/monster/monster/util.py", line 25, in <module>
    file_handler = logging.FileHandler("logs/{0}-{1}.log".format(name, time))
  File "/usr/lib64/python2.7/logging/__init__.py", line 902, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib64/python2.7/logging/__init__.py", line 925, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 2] No such file or directory: '/home/solo4572/workspace/jacobwagner/monster/logs/Monster-2014-04-09_15:07:39.log'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.