Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-3912

cfbs build should not traceback when there is nothing to build

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: (None)
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cfbs
    • Labels:

      Description

      When cfbs has no build steps it should provide a nice error along with a helpful suggestioin instead of a traceback.

      The error:

      Modules:
      Traceback (most recent call last):
        File "/home/nickanderson/.local/bin/cfbs", line 8, in <module>
          sys.exit(main())
        File "/home/nickanderson/.local/lib/python3.9/site-packages/cfbs/main.py", line 154, in main
          return commands.build_command()
        File "/home/nickanderson/.local/lib/python3.9/site-packages/cfbs/commands.py", line 1028, in build_command
          download_dependencies(prefer_offline=True)
        File "/home/nickanderson/.local/lib/python3.9/site-packages/cfbs/commands.py", line 858, in download_dependencies
          max_length = longest_module_name()
        File "/home/nickanderson/.local/lib/python3.9/site-packages/cfbs/commands.py", line 833, in longest_module_name
          return max((len(m["name"]) for m in get_definition()["build"]))
      ValueError: max() arg is an empty sequence
      
      

      Reproduction steps:

        rm -rf /tmp/cfbs; mkdir -p /tmp/cfbs
        cd /tmp/cfbs 
        cfbs init 
        cfbs build 
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            a10042 Nick Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: