Issue #2700
Updated by Ichimonji10 about 7 years ago
Let's say that you install crane (in my case, from the nightly RPM build) and create the following <code>/etc/crane.conf</code>: <pre><code>[general] data_dir: /var/lib/published/docker endpoint: localhost:5000 </code></pre> In this case, Let's say that you then try to start Crane will fail to start: <pre>[root@fedora-24-pulp-2-13 ~]# python with a systemd unit containing the following: <code>/usr/bin/python2 -c 'from crane.app import create_app; create_app().run(' File "<string>", line 1 from crane.app import create_app; create_app().run( ^ create_app().run()'</code>. If you do this, then Crane will fail to start, and the following will be dumped to the system log: <pre>Apr 10 16:43:29 fedora-24-pulp-2-13 systemd[1]: pulp-crane.service: Main process exited, code=exited, status=1/FAILURE SyntaxError: unexpected EOF while parsing Apr 10 16:43:29 fedora-24-pulp-2-13 systemd[1]: pulp-crane.service: Unit entered failed state. [root@fedora-24-pulp-2-13 ~]# python -c 'from crane.app import create_app; create_app().run()' Apr 10 16:43:29 fedora-24-pulp-2-13 systemd[1]: pulp-crane.service: Failed with result 'exit-code'. Apr 10 16:43:40 fedora-24-pulp-2-13 systemd[1]: Started Run Pulp Crane. Apr 10 16:43:41 fedora-24-pulp-2-13 python2[1461]: Traceback (most recent call last): Apr 10 16:43:41 fedora-24-pulp-2-13 python2[1461]: File "<string>", line 1, in <module> Apr 10 16:43:41 fedora-24-pulp-2-13 python2[1461]: File "/usr/lib/python2.7/site-packages/crane/app.py", line 29, in create_app Apr 10 16:43:41 fedora-24-pulp-2-13 python2[1461]: config.load(app) Apr 10 16:43:41 fedora-24-pulp-2-13 python2[1461]: File "/usr/lib/python2.7/site-packages/crane/config.py", line 59, in load Apr 10 16:43:41 fedora-24-pulp-2-13 python2[1461]: read_config(app, parser) Apr 10 16:43:41 fedora-24-pulp-2-13 python2[1461]: File "/usr/lib/python2.7/site-packages/crane/config.py", line 81, in read_config Apr 10 16:43:41 fedora-24-pulp-2-13 python2[1461]: app.config['DEBUG'] = parser.getboolean(SECTION_GENERAL, KEY_DEBUG) Apr 10 16:43:41 fedora-24-pulp-2-13 python2[1461]: File "/usr/lib64/python2.7/ConfigParser.py", line 368, in getboolean Apr 10 16:43:41 fedora-24-pulp-2-13 python2[1461]: v = self.get(section, option) Apr 10 16:43:41 fedora-24-pulp-2-13 python2[1461]: File "/usr/lib64/python2.7/ConfigParser.py", line 618, in get Apr 10 16:43:41 fedora-24-pulp-2-13 python2[1461]: raise NoOptionError(option, section) Apr 10 16:43:41 fedora-24-pulp-2-13 python2[1461]: ConfigParser.NoOptionError: No option 'debug' in section: 'general' Apr 10 16:43:41 fedora-24-pulp-2-13 systemd[1]: pulp-crane.service: Main process exited, code=exited, status=1/FAILURE Apr 10 16:43:41 fedora-24-pulp-2-13 systemd[1]: pulp-crane.service: Unit entered failed state. Apr 10 16:43:41 fedora-24-pulp-2-13 systemd[1]: pulp-crane.service: Failed with result 'exit-code'. </pre> This isn't expected. The documentation states that <code>debug</code> defaults to "false", meaning that the <code>debug</code> option should be optional. This affects the nightly builds of Crane for Pulp 2.12 and 2.13.