Skip to content
This repository was archived by the owner on Jan 19, 2018. It is now read-only.

Conversation

@cdrage
Copy link
Member

@cdrage cdrage commented Jan 26, 2016

Instead of erroring out:

2015-12-03 18:26:31,590 - atomicapp.cli.main - ERROR - argument of type 'NoneType' is not iterable
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/atomicapp-0.2.3-py2.7.egg/atomicapp/cli/main.py", line 74, in cli_run
    nm.run(**argdict)
  File "/usr/local/lib/python2.7/dist-packages/atomicapp-0.2.3-py2.7.egg/atomicapp/nulecule/main.py", line 187, in run
    self.nulecule.render(cli_provider, dryrun)
  File "/usr/local/lib/python2.7/dist-packages/atomicapp-0.2.3-py2.7.egg/atomicapp/nulecule/base.py", line 223, in render
    component.render(provider_key=provider_key, dryrun=dryrun)
  File "/usr/local/lib/python2.7/dist-packages/atomicapp-0.2.3-py2.7.egg/atomicapp/nulecule/base.py", line 348, in render
    if provider_key and provider_key not in self.artifacts:
TypeError: argument of type 'NoneType' is not iterable

It will error out with:

2016-01-26 11:30:27,838 - atomicapp.cli.main - ERROR - Unable to find artifact. Is the source path correct? 

Suggestions on wording is welcome.

@surajssd
Copy link
Collaborator

surajssd commented Feb 1, 2016

@cdrage about bug#438, it still does not fails if I keep the directory artifact and change the files name in the directory

(venv) [centos@atomic ~]$ cd nulecule-postgresql/
(venv) [centos@atomic nulecule-postgresql]$ sudo atomicapp run .
2016-02-01 09:13:52,238 - atomicapp.cli.main - INFO - Action/Mode Selected is: run
2016-02-01 09:13:52,246 - atomicapp.plugin - WARNING - Configuration option 'providerconfig' not found
2016-02-01 09:13:52,246 - atomicapp.plugin - WARNING - Configuration option 'providerconfig' not found
2016-02-01 09:13:52,246 - kubernetes - INFO - Using namespace default
2016-02-01 09:13:52,246 - kubernetes - INFO - trying kubectl at /usr/bin/kubectl
2016-02-01 09:13:52,246 - kubernetes - INFO - found kubectl at /usr/bin/kubectl
2016-02-01 09:13:52,246 - kubernetes - INFO - Deploying to Kubernetes

Your application resides in .
Please use this directory for managing your application

(venv) [centos@atomic nulecule-postgresql]$ 
(venv) [centos@atomic nulecule-postgresql]$ cat Nulecule 
---
specversion: 0.0.2  
id: postgresql-atomicapp

metadata:  
  name: PostgreSQL Atomic App
  appversion: 1.0.0
  description: This is PostgreSQL
graph:  
  - name: postgresql-atomicapp
    params:
      - name: db_user
        description: Database User
      - name: db_pass
        description: Database Password
      - name: db_name
        description: Database Name
    artifacts:
      kubernetes:
        - file://artifacts/kubernetes/postgresql-pod.yaml
        - file://artifacts/kubernetes/postgresql-service.yaml
      docker:
        - file://artifacts/docker/postgresql-app-pod_run
(venv) [centos@atomic nulecule-postgresql]$ 
(venv) [centos@atomic nulecule-postgresql]$ ls artifacts/
docker_bak  kubernetes_bak
(venv) [centos@atomic nulecule-postgresql]$ 

@cdrage
Copy link
Member Author

cdrage commented Feb 2, 2016

@surajssd
hi

I haven't update this PR yet since I've been at FOSDEM && cfg mgmt camp, but I will when I'm back in the land of maple syrup and igloos (canada) :) then I'll ping ya!

@cdrage cdrage changed the title Beautify failing of finding the artifact (dont merge yet) Beautify failing of finding the artifact Feb 8, 2016
@rtnpro
Copy link
Contributor

rtnpro commented Feb 9, 2016

@cdrage ping?

@cdrage
Copy link
Member Author

cdrage commented Feb 9, 2016

@rtnpro workin' on it :)

@cdrage cdrage force-pushed the inherited-app-erroring branch 4 times, most recently from 7ddd187 to 686166b Compare February 11, 2016 18:52
@cdrage
Copy link
Member Author

cdrage commented Feb 11, 2016

Hey @surajssd

I'm going to leave this PR as is for if the user does not specify an artifact within the Nulecule file.

I'll open up another PR relating to if the folder names are not correct (ex. if provided /foo/bar and only /foo/bar2 exists, etc.)

Otherwise, added tests for this.

Good for review!

@cdrage cdrage changed the title (dont merge yet) Beautify failing of finding the artifact Fail nicely if user does not provide artifact files within Nulecule. Feb 11, 2016
@dustymabe
Copy link
Contributor

If you are going to leave it like it is then remove Fixes 435 from the description please.

@cdrage
Copy link
Member Author

cdrage commented Feb 11, 2016

@dustymabe done!

@cdrage cdrage force-pushed the inherited-app-erroring branch from 686166b to 96045ab Compare February 11, 2016 21:06
@dustymabe
Copy link
Contributor

LGTM and ci.centos.org tests pass. Merging.

@dustymabe
Copy link
Contributor

Also would like to note that we could get by with not having checks all over the place in our code if we implemented something like #349 to validate the nulecule spec file before it got to the rest of the code.

dustymabe added a commit that referenced this pull request Feb 11, 2016
Fail nicely if user does not provide artifact files within Nulecule.
@dustymabe dustymabe merged commit 4c39293 into projectatomic:master Feb 11, 2016
@cdrage cdrage deleted the inherited-app-erroring branch February 11, 2016 21:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants