How to prevent trimming of sbt dependencyTree output - sbt

Is it possible to configure sbt such that output from sbt dependencyTree is not trimmed?
Fragment of trimmed output:
[info] | | | | | | +-com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.12...
[info] | | | | | | +-com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.14.0
[info] | | | | | | | +-com.fasterxml.jackson.core:jackson-core:2.14.0 (evicted by: ..
[info] | | | | | | | +-com.fasterxml.jackson.core:jackson-core:2.14.1
[info] | | | | | | | +-com.fasterxml.jackson.core:jackson-databind:2.14.0 (evicted ..
[info] | | | | | | | +-com.fasterxml.jackson.core:jackson-databind:2.14.1
[info] | | | | | | | +-com.fasterxml.jackson.core:jackson-annotations:2.14.1
[info] | | | | | | | +-com.fasterxml.jackson.core:jackson-core:2.14.1
Trimming is problematic for me, as the output of this command is picked up by snyk cli, which gets confused and reports false positives.
I am using sbt 1.8.0

dependencyTree tasks observe asciiGraphWidth option starting with sbt 1.6.0.
See sbt 1.6.0 release notes
Thus:
add asciiGraphWidth is build.sbt:
asciiGraphWidth := 180
alternatively, this can be passed in via command line:
sbt 'set asciiGraphWidth := 180' dependencyTree

Related

volume backup create what is errno 22?

Trying to create a volume backup both using the web UI and the cmd and keep getting errno 22. I'm unable to find information about the error or how to fix it. Anyone knows where I should start looking?
(openstack) volume backup create --force --name inventory01_vol_backups 398ee974-9b83-4918-9935-f52882b3e6b7
(openstack) volume backup show inventory01_vol_backups
+-----------------------+------------------------------------------------------------------+
| Field | Value |
+-----------------------+------------------------------------------------------------------+
| availability_zone | None |
| container | None |
| created_at | 2021-08-03T23:45:49.000000 |
| data_timestamp | 2021-08-03T23:45:49.000000 |
| description | None |
| fail_reason | [errno 22] RADOS invalid argument (error calling conf_read_file) |
| has_dependent_backups | False |
| id | 924c6e62-789e-4e51-9748-927695fc744c |
| is_incremental | False |
| name | inventory01_vol_backups |
| object_count | 0 |
| size | 30 |
| snapshot_id | None |
| status | error |
| updated_at | 2021-08-03T23:45:50.000000 |
| volume_id | 398ee974-9b83-4918-9935-f52882b3e6b7 |
+-----------------------+------------------------------------------------------------------+
The issue was caused due to a bug in Cinder version 16.2.1.dev13. Updating cinder to the latest version solved the issue

Does OpenstackSDK have support for usage metrics?

So...I'm facing a problem which I need the available amount of resources (and how are they being used) in the DCs (focusing on each project/server/network consume) of my Openstack (Stein) through python code (cause the other functionalities are in python and I don't like mixing languages if it have support for a functionality).
Are there any support for this on OpenstackSDK libraries? If yes, where to find the API documentation (or code examples of usage). If don't, why?
You can use existing Nova APIs to list down Compute capabilities and available resources.
nova hypervisor-stats
+----------------------+-------+
| Property | Value |
+----------------------+-------+
| count | 2 |
| current_workload | 0 |
| disk_available_least | 1378 |
| free_disk_gb | 1606 |
| free_ram_mb | 47003 |
| local_gb | 1606 |
| local_gb_used | 0 |
| memory_mb | 48027 |
| memory_mb_used | 1024 |
| running_vms | 0 |
| vcpus | 28 |
| vcpus_used | 0 |
+----------------------+-------+
You can automate it by wrapping it in shell or calling python-openstack lib.

openstack ocata glance creating 0 sized image

When I create new image using glance does not matter if using cli or gui I am getting returned code 0 and image is created but its size is zero.
The behavior is slightly different as from GUI my browser crushes but stil image is created from cli I am getting return code 0.
Command:
openstack image create --file cirros-0.4.0-x86_64-disk.img --disk-format qcow2 --container-format bare --public --debug cirros-deb
+------------------+------------------------------------------------------+
| Field | Value |
+------------------+------------------------------------------------------+
| checksum | d41d8cd98f00b204e9800998ecf8427e |
| container_format | bare |
| created_at | 2018-01-20T23:24:47Z |
| disk_format | qcow2 |
| file | /v2/images/c695bc30-731d-4a4f-ab0f-12eb972d8188/file |
| id | c695bc30-731d-4a4f-ab0f-12eb972d8188 |
| min_disk | 0 |
| min_ram | 0 |
| name | cirros-deb |
| owner | a3460a3b0e8f4d0bbdd25bf790fe504c |
| protected | False |
| schema | /v2/schemas/image |
| size | 0 |
| status | active |
| tags | |
| updated_at | 2018-01-20T23:24:47Z |
| virtual_size | None |
| visibility | public |
+------------------+------------------------------------------------------+
clean_up CreateImage:
END return value: 0
I tried with different cirros image and with ubuntu cloud image always behavior is the same.
Under /var/lib/glance/images file is created with size 0:
-rw-r-----. 1 glance glance 0 Jan 21 00:24 c695bc30-731d-4a4f-ab0f-12eb972d8188
grep c695bc30-731d-4a4f-ab0f-12eb972d8188 glance/api.log
2018-01-21 00:24:47.915 1894 INFO eventlet.wsgi.server [req-7246cd30-47c4-41a5-b358-c8e5cc0f4e56 8bd3e4905ffb4f698e2476d9080a7d90 a3460a3b0e8f4d0bbdd25bf790fe504c - default default] 172.19.254.50 - - [21/Jan/2018 00:24:47] "PUT /v2/images/c695bc30-731d-4a4f-ab0f-12eb972d8188/file HTTP/1.1" 204 213 0.111323
2018-01-21 00:24:47.931 1894 INFO eventlet.wsgi.server [req-28e0cda2-c9f7-4543-b19a-d59eccffa47e 8bd3e4905ffb4f698e2476d9080a7d90 a3460a3b0e8f4d0bbdd25bf790fe504c - default default] 172.19.254.50 - - [21/Jan/2018 00:24:47] "GET /v2/images/c695bc30-731d-4a4f-ab0f-12eb972d8188 HTTP/1.1" 200 780 0.015399
Any idea what can be wrong?
Find location of python glance client.
find / -name http.py
vi /usr/lib/python2.7/site-packages/glanceclient/common/http.py
- data = self._chunk_body(data)
+ pass
Referenc:
https://bugs.launchpad.net/python-glanceclient/+bug/1666511
https://ask.openstack.org/en/question/101944/why-does-openstack-image-create-of-cirros-result-in-size-0/?answer=102303#post-id-102303

How to change working directory in scons

I have a project built with make, but I want to shift to scons.
However, I could not link object files in scons, so I want to know how to change working directory in scons.
What I exactly want is
make -C $(OBJECTDIRECTORY) -f $(SOURCEDIRECTORY)./Makefile InternalDependency
This is one line from my Makefile, and works well.
However, when scons builds my project, it does
x86_64-pc-linux-ld -o build/kernel32/kernel32.elf -melf_i386 -T scripts/elf_i386.x -nostdlib -e main -Ttext 0x10200 build/kernel32/asmUtils.o build/kernel32/cpu.o build/kernel32/main.o build/kernel32/memory.o build/kernel32/pageManager.o build/kernel32/utils.o
and got an error,
x86_64-pc-linux-ld: cannot find main.o
. Even thouh I do same command in shell manually, I got the same error.
However, if I move to build/kernel32, and do manually
x86_64-pc-linux-ld -o kernel32.elf -melf_i386 -T ../../elf_i386.x -nostdlib -e main -Ttext 0x10200 main.o cpu.o memory.o pageManager.o utils.o asmUtils.o
and it works.
My assumption is ld could not link object files in some upper directory.
So, is there any way to do like "-C" option of Make?
Or any other workaround wayin scons?
Here is my SConscript, and SConsctruct.
In project root directory,
#SConstruct
build_dir = 'build'
# Build
SConscript(['src/SConscript'], variant_dir = build_dir, duplicate = 0)
# Clean
Clean('.', build_dir)
In src directory
#SConscript for src
SConscript(['bootloader/SConscript',
'kernel32/SConscript'])
In kernel32 directory
#SConscript for kernel32
import os, sys
# Build entry
env_entry = Environment(tools=['default', 'nasm'])
target_entry = 'entry.bin'
object_entry = 'entry.s'
output_entry = env_entry.Object(target_entry, object_entry)
# Compile CPP
env_gpp_options = {
'CXX' : 'x86_64-pc-linux-g++',
'CXXFLAGS' : '-std=c++11 -g -m32 -ffreestanding -fno-exceptions -fno-rtti',
'LINK' : 'x86_64-pc-linux-ld',
'LINKFLAGS' : '-melf_i386 -T scripts/elf_i386.x -nostdlib -e main -Ttext 0x10200',
}
env_gpp = Environment(**env_gpp_options)
env_gpp.Append(ENV = {'PATH' : os.environ['PATH']})
object_cpp_list = Glob('*.cpp')
for object_cpp in object_cpp_list:
env_gpp.Object(object_cpp)
# Compile ASM
env_nasm = Environment(tools=['default', 'nasm'])
env_nasm.Append(ASFLAGS='-f elf32')
object_nasm_list = Glob('*.asm')
for object_nasm in object_nasm_list:
env_nasm.Object(object_nasm)
# Find all object file
object_target_list = Glob('*.o')
object_target_list.append('entry.bin')
# Linking
env_link_target = 'kernel32.elf'
env_gpp.Program(env_link_target, object_target_list)
Pleas let me know. Thank you.
The log for "--tree=prune" is
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
x86_64-pc-linux-ld -o build/kernel32/kernel32.elf -melf_i386 -T scripts/elf_i386.x -nostdlib -e main -Ttext 0x10200 build/kernel32/asmUtils.o build/kernel32/cpu.o build/kernel32/main.o build/kernel32/memory.o build/kernel32/pageManager.o build/kernel32/utils.o build/kernel32/entry.bin
+-.
+-SConstruct
+-build
| +-src/SConscript
| +-build/bootloader
| | +-src/bootloader/BootLoader.asm
| | +-src/bootloader/SConscript
| | +-build/bootloader/bootloader.bin
| | +-src/bootloader/BootLoader.asm
| | +-/usr/bin/nasm
| +-build/kernel32
| +-src/kernel32/SConscript
| +-src/kernel32/asmUtils.asm
| +-build/kernel32/asmUtils.o
| | +-src/kernel32/asmUtils.asm
| | +-/usr/bin/nasm
| +-src/kernel32/cpu.cpp
| +-build/kernel32/cpu.o
| | +-src/kernel32/cpu.cpp
| | +-src/kernel32/cpu.hpp
| | +-src/kernel32/types.hpp
| | +-/home/xaliver/BuildTools/cross/bin/x86_64-pc-linux-g++
| +-build/kernel32/entry.bin
| | +-src/kernel32/entry.s
| | +-/usr/bin/nasm
| +-src/kernel32/entry.s
| +-build/kernel32/kernel32.elf
| | +-[build/kernel32/asmUtils.o]
| | +-[build/kernel32/cpu.o]
| | +-build/kernel32/main.o
| | | +-src/kernel32/main.cpp
| | | +-src/kernel32/cpu.hpp
| | | +-src/kernel32/memory.hpp
| | | +-src/kernel32/types.hpp
| | | +-src/kernel32/utils.hpp
| | | +-src/kernel32/pageManager.hpp
| | | +-src/kernel32/page.hpp
| | | +-/home/xaliver/BuildTools/cross/bin/x86_64-pc-linux-g++
| | +-build/kernel32/memory.o
| | | +-src/kernel32/memory.cpp
| | | +-src/kernel32/memory.hpp
| | | +-src/kernel32/pageManager.hpp
| | | +-src/kernel32/page.hpp
| | | +-src/kernel32/types.hpp
| | | +-/home/xaliver/BuildTools/cross/bin/x86_64-pc-linux-g++
| | +-build/kernel32/pageManager.o
| | | +-src/kernel32/pageManager.cpp
| | | +-src/kernel32/pageManager.hpp
| | | +-src/kernel32/page.hpp
| | | +-src/kernel32/types.hpp
| | | +-/home/xaliver/BuildTools/cross/bin/x86_64-pc-linux-g++
| | +-build/kernel32/utils.o
| | | +-src/kernel32/utils.cpp
| | | +-src/kernel32/utils.hpp
| | | +-src/kernel32/types.hpp
| | | +-/home/xaliver/BuildTools/cross/bin/x86_64-pc-linux-g++
| | +-[build/kernel32/entry.bin]
| | +-/home/xaliver/BuildTools/cross/bin/x86_64-pc-linux-ld
| +-src/kernel32/main.cpp
| +-[build/kernel32/main.o]
| +-src/kernel32/memory.cpp
| +-[build/kernel32/memory.o]
| +-src/kernel32/pageManager.cpp
| +-[build/kernel32/pageManager.o]
| +-src/kernel32/utils.cpp
| +-[build/kernel32/utils.o]
+-src
+-src/SConscript
+-src/bootloader
| +-src/bootloader/BootLoader.asm
| +-src/bootloader/SConscript
+-src/kernel32
+-src/kernel32/SConscript
+-src/kernel32/asmUtils.asm
+-src/kernel32/cpu.cpp
+-src/kernel32/cpu.hpp
+-src/kernel32/entry.s
+-src/kernel32/main.cpp
+-src/kernel32/memory.cpp
+-src/kernel32/memory.hpp
+-src/kernel32/page.hpp
+-src/kernel32/pageManager.cpp
+-src/kernel32/pageManager.hpp
+-src/kernel32/types.hpp
+-src/kernel32/utils.cpp
+-src/kernel32/utils.hpp
scons: building terminated because of errors.

Testcase level variables in [Documentation] for robot framework

I cannot get test level variables to appear in documentation.
Let's say I have this testsuite:
| *Variables* |
| ${SystemUnderTest} = | Staging
| *testcase* |
| Device Test |
| | Set Test Variable | ${device} | iPhone
| | [Documentation] | Device is: ${device} |
| | ... | System is: ${SystemUnderTest} |
| | No Operation
That produces this log:
TEST CASE: Device TestExpand All
Full Name: T.Device Test
Documentation:
Device is: ${device} System is: Staging
Notice that the Suite level variable is treated properly, but the test level one is not.
How do I get all variables to be treated equally?
Starting with robotframework 2.7 there is a built-in keyword named Set test documentation, which can be used to replace or append to the existing documentation. This will not affect the output in the console, but the changes will be reflected in the log and report.
For example:
| *Variables* |
| ${SystemUnderTest} = | Staging
| *testcase* |
| Device Test |
| | Set Test Variable | ${device} | iPhone
| | [Documentation] | Device is: ${device} |
| | ... | System is: ${SystemUnderTest} |
| | Substitute vars in documentation
| | No Operation
| *Keywords* |
| Substitute vars in documentation
| | ${doc}= | replace variables | ${test documentation}
| | set test documentation | ${doc}
For more information see http://robotframework.googlecode.com/hg/doc/libraries/BuiltIn.html?r=2.7.7#Set%20Test%20Documentation
This solution feels a little hackerish to me, but it does give you the functionality that you want.
Test.txt
| *Setting* | *Value* |
# This should start as the value for your first test
| Suite Setup | Set Suite Variable | ${device} | foo
| *Test Case* | *Action* | *Argument*
#
| T100 | [Documentation] | Should be foo: ${device}
# Do some stuff
| | No Operation
# This setups the device name for the next test.
| | Set Suite Variable | ${device} | bar
#
| T101 | [Documentation] | Should be bar: ${device}
# Do some stuff
| | No Operation
| | Set Suite Variable | ${device} | bing
#
| T102 | [Documentation] | Should be bing: ${device}
# Do some stuff
| | No Operation
When I run the suite I get this output:
==============================================================================
Test
==============================================================================
T100 :: Should be foo: foo | PASS |
------------------------------------------------------------------------------
T101 :: Should be bar: bar | PASS |
------------------------------------------------------------------------------
T102 :: Should be bing: bing | PASS |
------------------------------------------------------------------------------
Test | PASS |
3 critical tests, 3 passed, 0 failed
3 tests total, 3 passed, 0 failed
==============================================================================
Having the device variable set at the end of the previous test is a little unclean, but as long you leave a comment it shouldn't be unclear at all.

Resources